gumble_ffmpeg

package
v0.0.0-...-d98ca20 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 25, 2019 License: GPL-3.0, MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultCommand = "ffmpeg"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Source

type Source interface {
	// contains filtered or unexported methods
}

func SourceExec

func SourceExec(name string, arg ...string) Source

func SourceFile

func SourceFile(filename string) Source

SourceFile is standard file source.

func SourceReader

func SourceReader(r io.ReadCloser) Source

SourceReader is a ReadCloser source.

type Stream

type Stream struct {
	// Command to execute to play the file. Defaults to "ffmpeg".
	Command string
	// Playback volume. This value can be changed while the source is playing.
	Volume float32
	// Audio source. This value should not be changed until the stream is done
	// playing.
	Source Source
	// Starting offset.
	Offset time.Duration
	// The amount of audio that has been played by the stream (resets when a
	// source starts from the beginning).
	Elapsed time.Duration
	// contains filtered or unexported fields
}

func New

func New(client *gumble.Client) *Stream

New creates a new stream on the given gumble client.

func (*Stream) IsActive

func (s *Stream) IsActive() bool

IsActive returns if a stream is playing or paused.

func (*Stream) IsPaused

func (s *Stream) IsPaused() bool

IsPaused returns if a stream is paused.

func (*Stream) IsPlaying

func (s *Stream) IsPlaying() bool

IsPlaying returns if a stream is playing.

func (*Stream) Pause

func (s *Stream) Pause() error

Pause pauses the currently playing stream.

func (*Stream) Play

func (s *Stream) Play() error

Play starts playing a stream to the gumble client. If the stream is paused, it will be resumed. Returns non-nil if the stream could not be started.

func (*Stream) Stop

func (s *Stream) Stop() error

Stop stops the currently playing stream.

func (*Stream) Wait

func (s *Stream) Wait()

Wait returns once the stream has finished playing (pausing will not cause this function to return).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL