Documentation
¶
Overview ¶
Package dolby decodes AC-3 and single-program E-AC-3 packets to planar PCM.
Index ¶
Constants ¶
const ( // BlockLength is the samples per channel of an audio block. BlockLength = 256 // FrameLength is the samples per channel of an AC-3 syncframe, its six // audio blocks, and so of an MP4 sample of AC-3. FrameLength = 6 * BlockLength // MaxChannels is the stride of the core PCM scratch buffer. MaxChannels = 6 )
const ( Left = iota Right Center LFE LeftSurround RightSurround )
Speaker lanes in the interleaved core scratch buffer.
const ( ModeDualMono = 0 // 1+1: two independent mono channels, Ch1 and Ch2 ModeMono = 1 // 1/0: C ModeStereo = 2 // 2/0: L, R Mode30 = 3 // 3/0: L, C, R Mode21 = 4 // 2/1: L, R, S Mode31 = 5 // 3/1: L, C, R, S Mode22 = 6 // 2/2: L, R, Ls, Rs Mode32 = 7 // 3/2: L, C, R, Ls, Rs )
Audio coding modes, the acmod of a stream: its full-bandwidth channels, as the front ones / the surround ones.
Variables ¶
var ( // ErrFormat is wrapped by the errors of data that is not AC-3, or is // corrupt. ErrFormat = errors.New("ac3: invalid data") // ErrBufferTooSmall is returned by Decode for room for less than the // frames of the data. ErrBufferTooSmall = errors.New("ac3: buffer too small") )
var ErrUnsupported = errors.ErrUnsupported
ErrUnsupported identifies a valid feature outside the decoder's capability.
Functions ¶
This section is empty.
Types ¶
type Decoder ¶
type Decoder struct {
// contains filtered or unexported fields
}
Decoder maintains overlap and dither state for one AC-3 or E-AC-3 track. Its output is borrowed until the next Decode call. Use it in one goroutine.
func NewDecoder ¶
NewDecoder determines the format from the leading program in packet. Pass that packet to Decode to obtain its PCM.