Versions in this module Expand all Collapse all v2 v2.0.0 Aug 25, 2021 Changes in this version + const FormatVersion + const GitHubRepositoryURL + const LibraryVersion + var ErrBadFrame = errors.New("Bad Frame") + var ErrNegativeFrameSize = errors.New("Frame size is negative, possibly corrupted.") + var ErrNotDCA = errors.New("DCA Magic header not found, either not dca or raw dca frames") + var ErrNotFirstFrame = errors.New("Metadata can only be found in the first frame") + var Logger *log.Logger + var StdEncodeOptions = &EncodeOptions + func DecodeFrame(r io.Reader) (frame []byte, err error) + type AudioApplication string + var AudioApplicationAudio AudioApplication = "audio" + var AudioApplicationLowDelay AudioApplication = "lowdelay" + var AudioApplicationVoip AudioApplication = "voip" + type DCAMetadata struct + Tool *DCAToolMetadata + Version int8 + type DCAToolMetadata struct + Author string + Name string + Url string + Version string + type Decoder struct + FormatVersion int + Metadata *Metadata + func NewDecoder(r io.Reader) *Decoder + func (d *Decoder) FrameDuration() time.Duration + func (d *Decoder) OpusFrame() (frame []byte, err error) + func (d *Decoder) ReadMetadata() error + type EncodeOptions struct + Application AudioApplication + AudioFilter string + Bitrate int + BufferedFrames int + Channels int + Comment string + CompressionLevel int + CoverFormat string + FrameDuration int + FrameRate int + PacketLoss int + RawOutput bool + StartTime int + Threads int + VBR bool + Volume int + func (e EncodeOptions) PCMFrameLen() int + func (opts *EncodeOptions) Validate() error + type EncodeSession struct + func EncodeFile(path string, options *EncodeOptions) (session *EncodeSession, err error) + func EncodeMem(r io.Reader, options *EncodeOptions) (session *EncodeSession, err error) + func (e *EncodeSession) Cleanup() + func (e *EncodeSession) Error() error + func (e *EncodeSession) FFMPEGMessages() string + func (e *EncodeSession) FrameDuration() time.Duration + func (e *EncodeSession) Options() *EncodeOptions + func (e *EncodeSession) OpusFrame() (frame []byte, err error) + func (e *EncodeSession) Read(p []byte) (n int, err error) + func (e *EncodeSession) ReadFrame() (frame []byte, err error) + func (e *EncodeSession) Running() (running bool) + func (e *EncodeSession) Stats() *EncodeStats + func (e *EncodeSession) Stop() error + func (e *EncodeSession) Truncate() + type EncodeStats struct + Bitrate float32 + Duration time.Duration + Size int + Speed float32 + type ExtraMetadata struct + type FFprobeFormat struct + Bitrate string + Duration string + FileName string + FormatLongName string + FormatName string + NumPrograms int + NumStreams int + ProbeScore int + Size string + StartTime string + Tags *FFprobeTags + type FFprobeMetadata struct + Format *FFprobeFormat + type FFprobeTags struct + Album string + Artist string + Compilation string + Date string + Genre string + Title string + Track string + type Frame struct + type Metadata struct + Dca *DCAMetadata + Extra *ExtraMetadata + Opus *OpusMetadata + Origin *OriginMetadata + SongInfo *SongMetadata + type OpusMetadata struct + Application string + Bitrate int + Channels int + FrameSize int + SampleRate int + VBR bool + type OpusReader interface + FrameDuration func() time.Duration + OpusFrame func() (frame []byte, err error) + type OriginMetadata struct + Bitrate int + Channels int + Encoding string + Source string + Url string + type SongMetadata struct + Album string + Artist string + Comments string + Cover *string + Genre string + Title string