Documentation ¶
Overview ¶
Package mp3lib is a simple library for parsing MP3 files.
Index ¶
Constants ¶
const ( MPEGVersion2_5 = iota MPEGVersionReserved MPEGVersion2 MPEGVersion1 )
MPEG version enum.
const ( MPEGLayerReserved = iota MPEGLayerIII MPEGLayerII MPEGLayerI )
MPEG layer enum.
const ( Stereo = iota JointStereo DualChannel Mono )
Channel mode enum.
const Version = "1.0.0"
Library version.
Variables ¶
var DebugMode = false
Flag controlling the display of debugging information.
Functions ¶
func IsVbriHeader ¶
IsVbriHeader returns true if the supplied frame is a Fraunhofer VBRI header.
func IsXingHeader ¶
IsXingHeader returns true if the supplied frame is an Xing VBR header.
func NextObject ¶
NextObject loads the next recognised object from the input stream. Skips over unrecognised/garbage data. Returns *MP3Frame, *ID3v1Tag, *ID3v2Tag, or nil when the stream has been exhausted.
Types ¶
type ID3v2Tag ¶
type ID3v2Tag struct {
RawBytes []byte
}
ID3v2Tag represents an ID3v2 metadata tag.
func NextID3v2Tag ¶
NextID3v2Tag loads the next ID3v2 tag from the input stream, skipping all other data. Returns nil when the stream has been exhausted.
type MP3Frame ¶
type MP3Frame struct { MPEGVersion byte MPEGLayer byte CrcProtection bool BitRate int SamplingRate int PaddingBit bool PrivateBit bool ChannelMode byte ModeExtension byte CopyrightBit bool OriginalBit bool Emphasis byte SampleCount int FrameLength int RawBytes []byte }
MP3Frame represents an individual frame parsed from an MP3 stream.
func NewXingHeader ¶
NewXingHeader creates a new Xing header frame for a VBR file.