Documentation ¶
Index ¶
- Constants
- Variables
- func ExitMpg123()
- func GetEncodingBitsPerSample(encoding int) int
- func InitializeMpg123()
- func SupportedDecoders() []string
- type Decoder
- func (d *Decoder) Close() error
- func (d *Decoder) CurrentDecoder() string
- func (d *Decoder) Decode(buf []byte) ([]byte, error)
- func (d *Decoder) DecodeSamples(samples int, audio []byte) (int, error)
- func (d *Decoder) DecoderReader(src io.Reader, fps int, channels int, encoding int) *DecoderReader
- func (d *Decoder) Delete()
- func (d *Decoder) Feed(buf []byte) error
- func (d *Decoder) Format(rate int, channels int, encodings int)
- func (d *Decoder) FormatAll()
- func (d *Decoder) FormatNone()
- func (d *Decoder) GetFormat() (rate int, channels int, encoding int)
- func (d *Decoder) GetLengthInPCMFrames() int
- func (d *Decoder) MonoDecoderReader(src io.Reader, fps int, encoding int) *DecoderReader
- func (d *Decoder) Open(file string) error
- func (d *Decoder) OpenFeed() error
- func (d *Decoder) OpenFile(f *os.File) error
- func (d *Decoder) Param(paramType int, value int64, fvalue float64) error
- func (d *Decoder) Read(buf []byte) (int, error)
- func (d *Decoder) ReadAudioFrames(frames int, buf []byte) (int, error)
- func (d *Decoder) Seek(offset int64, whence int) (int64, error)
- func (d *Decoder) TellCurrentSample() int64
- type DecoderReader
Constants ¶
const ( ENC_8 = C.MPG123_ENC_8 ENC_16 = C.MPG123_ENC_16 ENC_24 = C.MPG123_ENC_24 ENC_32 = C.MPG123_ENC_32 ENC_SIGNED = C.MPG123_ENC_SIGNED ENC_FLOAT = C.MPG123_ENC_FLOAT ENC_SIGNED_8 = C.MPG123_ENC_SIGNED_8 ENC_UNSIGNED_8 = C.MPG123_ENC_UNSIGNED_8 ENC_ULAW_8 = C.MPG123_ENC_ULAW_8 ENC_ALAW_8 = C.MPG123_ENC_ALAW_8 ENC_SIGNED_16 = C.MPG123_ENC_SIGNED_16 ENC_UNSIGNED_16 = C.MPG123_ENC_UNSIGNED_16 ENC_SIGNED_24 = C.MPG123_ENC_SIGNED_24 ENC_UNSIGNED_24 = C.MPG123_ENC_UNSIGNED_24 ENC_SIGNED_32 = C.MPG123_ENC_SIGNED_32 ENC_UNSIGNED_32 = C.MPG123_ENC_UNSIGNED_32 ENC_FLOAT_32 = C.MPG123_ENC_FLOAT_32 ENC_FLOAT_64 = C.MPG123_ENC_FLOAT_64 ENC_ANY = C.MPG123_ENC_ANY ADD_FLAGS = C.MPG123_ADD_FLAGS QUIET = C.MPG123_QUIET )
All output encoding formats supported by mpg123
const ( IN_MAX_BUFFER_SIZE = 16384 OUT_MAX_BUFFER_SIZE = 32768 )
Variables ¶
var EOF = errors.New("EOF")
Functions ¶
func ExitMpg123 ¶
func ExitMpg123()
func GetEncodingBitsPerSample ¶
int mpg123_encsize ( int encoding )
func InitializeMpg123 ¶
func InitializeMpg123()
func SupportedDecoders ¶
func SupportedDecoders() []string
const char** mpg123_supported_decoders(void)
Types ¶
type Decoder ¶
Contains a handle for and mpg123 decoder instance
func NewDecoder ¶
NewDecoder creates a new mpg123 decoder instance
func (*Decoder) CurrentDecoder ¶
const char* mpg123_current_decoder(mpg123_handle *mh)
func (*Decoder) DecodeSamples ¶
func (*Decoder) DecoderReader ¶
func (d *Decoder) DecoderReader( src io.Reader, fps int, channels int, encoding int, ) *DecoderReader
DecoderReader gives you an io.Reader for streaming-decoding. It performs a combination of Feed and Read, and relies on you to first call OpenFeed before invoking DecoderReader.Read.
func (*Decoder) FormatAll ¶
func (d *Decoder) FormatAll()
FromatAll enables all decoder output formats (this is the default setting)
func (*Decoder) FormatNone ¶
func (d *Decoder) FormatNone()
FormatNone disables all decoder output formats (used to specifying supported formats)
func (*Decoder) GetLengthInPCMFrames ¶
off_t mpg123_length(mpg123_handle * mh)
func (*Decoder) MonoDecoderReader ¶
MonoDecoderReader is an alias that gives you an io.Reader for decoding a stream that is known to be mono-channeled.
func (*Decoder) ReadAudioFrames ¶
func (*Decoder) TellCurrentSample ¶
off_t mpg123_tell(mpg123_handle *mh)
type DecoderReader ¶
type DecoderReader struct {
// contains filtered or unexported fields
}
DecoderReader is the way to decode streaming MP3
func (DecoderReader) Nuke ¶
func (dr DecoderReader) Nuke()
Nuke kills our DecoderReader appropriately
func (*DecoderReader) Paranoid ¶
func (dr *DecoderReader) Paranoid() *DecoderReader
Paranoid mode shuts off the decoder on a non-EOF error (handy if your input is a duplex network stream).