mpg123

package
v0.0.0-...-cbce8f1 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
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
)

All output encoding formats supported by mpg123

Variables

View Source
var EOF = errors.New("EOF")

Functions

This section is empty.

Types

type Decoder

type Decoder struct {
	// contains filtered or unexported fields
}

Contains a handle for and mpg123 decoder instance

func NewDecoder

func NewDecoder() (*Decoder, error)

NewDecoder creates a new mpg123 decoder instance

func (*Decoder) Close

func (d *Decoder) Close() error

Close closes an input file if one was opened by mpg123

func (*Decoder) Delete

func (d *Decoder) Delete()

Delete frees an mpg123 decoder instance

func (*Decoder) Feed

func (d *Decoder) Feed(buf []byte) error

Feed provides data bytes into the decoder

func (*Decoder) Format

func (d *Decoder) Format(rate int64, channels int, encodings int)

Format sets the audio output format for decoder

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) GetFormat

func (d *Decoder) GetFormat() (rate int64, channels int, encoding int)

GetFormat returns current output format

func (*Decoder) Open

func (d *Decoder) Open(file string) error

Open initializes a decoder for an mp3 file using a filename

func (*Decoder) OpenFeed

func (d *Decoder) OpenFeed() error

OpenFeed prepares a decoder for direct feeding via Feed(..)

func (*Decoder) OpenFile

func (d *Decoder) OpenFile(f *os.File) error

OpenFile binds to an fd from an open *os.File for decoding

func (*Decoder) OutBlock

func (d *Decoder) OutBlock() int

func (*Decoder) Read

func (d *Decoder) Read(buf []byte) (int, error)

Read decodes data and into buf and returns number of bytes decoded.

func (*Decoder) Seek

func (d *Decoder) Seek(offset int16, set int) (int16, error)

Feed provides data bytes into the decoder

func (*Decoder) VolumeChange

func (d *Decoder) VolumeChange(value float32) error

Jump to

Keyboard shortcuts

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