Documentation ¶
Index ¶
Constants ¶
View Source
const ( STEREO = iota JOINT_STEREO // stereo DUAL_CHANNE // two mono chans SINGLE_CHANNEL // mono )
Variables ¶
View Source
var APEHeader = []byte{'A', 'P', 'E', 'T'}
View Source
var BitrateLookupTable = [][][]uint64{ MPEG2BitrateTable, {ZeroedBitrates, ZeroedBitrates, ZeroedBitrates, ZeroedBitrates}, MPEG2BitrateTable, MPEG1BitrateTable, }
Lookup by Version, Layer, and Bitrate Index
View Source
var ID3v1Header = []byte{'T', 'A', 'G'}
View Source
var ID3v1Size = 128
View Source
var ID3v2Header = []byte{'I', 'D', '3'}
View Source
var MPEG1BitrateTable = [][]uint64{ ZeroedBitrates, {0, 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320, 0}, {0, 32, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320, 384, 0}, {0, 32, 64, 96, 128, 160, 192, 224, 256, 288, 320, 352, 384, 416, 448, 0}, }
View Source
var MPEG2BitrateTable = [][]uint64{ ZeroedBitrates, MPEG2L2L3Bitrates, MPEG2L2L3Bitrates, MPEG2L1Bitrates, }
View Source
var MPEG2L1Bitrates = []uint64{0, 32, 48, 56, 64, 80, 96, 112, 128, 144, 160, 176, 192, 224, 256, 0}
View Source
var MPEG2L2L3Bitrates = []uint64{0, 8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 144, 160, 0}
View Source
var SamplerateLookupTable = [][]uint64{
{11025, 12000, 8000, 0},
{0, 0, 0, 0},
{22050, 24000, 16000, 0},
{44100, 48000, 32000, 0},
}
Lookup by Version, Samplerate Index
View Source
var SamplesLookupTable = [][]uint64{
{0, 576, 1152, 384},
{0, 0, 0, 0},
{0, 576, 1152, 384},
{0, 1152, 1152, 384},
}
Lookup by Version, Layer
View Source
var ZeroedBitrates = []uint64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
Functions ¶
This section is empty.
Types ¶
type AudioFrame ¶
type AudioFrame struct { Version MPEGVersion Layer MPEGLayer CRC bool BitrateIndex uint8 SamplerateIndex uint8 Padding uint8 Private bool Mode uint8 ModeExt uint8 Copyright bool Original bool Emphasis uint8 Bitrate uint64 Samplerate uint64 Size uint64 }
information about one mp3 audio frame
type MP3Info ¶
type MP3Info struct { Bitrate uint64 IsVBR bool HasXingHeader bool HasVBRiHeader bool Samplerate uint64 Duration time.Duration HasID3v1 bool ID3v2 *ID3v2Tag Ape *ApeTag FoundLayer1 bool FoundLayer2 bool FoundLayer3 bool FoundMPEG1 bool FoundMPEG2 bool FoundMPEG25 bool UnknownBytes uint64 FrameCount int StartGarbage int64 }
func InspectFile ¶
type MPEGVersion ¶
type MPEGVersion int
const ( MPEG25 MPEGVersion = iota MPEG_RESERVED MPEG2 MPEG1 )
type Scanner ¶
func NewMP3Scanner ¶
func NewMP3Scanner(f io.ReadSeeker) (*Scanner, error)
func NewScanner ¶
func NewScanner(f io.ReadSeeker, version MPEGVersion, layer MPEGLayer) (*Scanner, error)
Click to show internal directories.
Click to hide internal directories.