ratz/src/communication/media/dca/encode.go

type AudioApplication

var AudioApplicationVoip

var AudioApplicationAudio

var AudioApplicationLowDelay

var ErrBadFrame

type EncodeOptions

func (e EncodeOptions) PCMFrameLen() int {}

// Validate returns an error if the options are not correct
func (opts *EncodeOptions) Validate() error {}

var StdEncodeOptions

type EncodeStats

type Frame

type EncodeSession

// EncodeMem EncodeMem EncodeMem encodes data from memory
func EncodeMem(r io.Reader, options *EncodeOptions) (session *EncodeSession, err error) {}

// EncodeFile encodes the file/url/other in path
func EncodeFile(path string, options *EncodeOptions) (session *EncodeSession, err error) {}

func (e *EncodeSession) run() {}

func (e *EncodeSession) writeMetadataFrame() {}

func (e *EncodeSession) readStderr(stderr io.ReadCloser, wg *sync.WaitGroup) {}

func (e *EncodeSession) handleStderrLine(line string) {}

func (e *EncodeSession) readStdout(stdout io.ReadCloser) {}

func (e *EncodeSession) writeOpusFrame(opusFrame []byte) error {}

// Stop stops the encoding session
func (e *EncodeSession) Stop() error {}

// ReadFrame blocks until a frame is read or there are no more frames
// Note: If rawoutput is not set, the first frame will be a metadata frame
func (e *EncodeSession) ReadFrame() (frame []byte, err error) {}

// OpusFrame implements OpusReader, returning the next opus frame
func (e *EncodeSession) OpusFrame() (frame []byte, err error) {}

// Running returns true if running
func (e *EncodeSession) Running() (running bool) {}

// Stats returns ffmpeg stats, NOTE: this is not playback stats but transcode stats.
// To get how far into playback you are
// you have to track the number of frames sent to discord yourself
func (e *EncodeSession) Stats() *EncodeStats {}

// Options returns the options used
func (e *EncodeSession) Options() *EncodeOptions {}

// Truncate is deprecated, use Cleanup instead
// this will be removed in a future version
func (e *EncodeSession) Truncate() {}

// Cleanup cleans up the encoding session, throwring away all unread frames and stopping ffmpeg
// ensuring that no ffmpeg processes starts piling up on your system
// You should always call this after it's done
func (e *EncodeSession) Cleanup() {}

// Read implements io.Reader,
// n == len(p) if err == nil, otherwise n contains the number bytes read before an error occured
func (e *EncodeSession) Read(p []byte) (n int, err error) {}

// FrameDuration implements OpusReader, retruning the duratio of each frame
func (e *EncodeSession) FrameDuration() time.Duration {}

// Error returns any error that occured during the encoding process
func (e *EncodeSession) Error() error {}

// FFMPEGMessages returns messages printed by ffmpeg to stderr, you can use this to see what ffmpeg is saying if your encoding fails
func (e *EncodeSession) FFMPEGMessages() string {}