Documentation
¶
Overview ¶
Package ac3 encodes AC-3 (Dolby Digital, ATSC A/52): PCM in, frames any AC-3 decoder plays out. 48 kHz, mono to 5.1, the bit rates A/52 allows; long blocks, no coupling.
Index ¶
Constants ¶
const Delay = 256
Delay is how many samples the coded audio lags its input: the first frame's first block overlaps silence before the input.
const FrameSamples = 1536
FrameSamples is how many samples per channel a frame codes.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Encoder ¶
type Encoder struct {
// contains filtered or unexported fields
}
Encoder codes PCM as AC-3 frames.
func NewEncoder ¶
NewEncoder makes an encoder for channels (1 to 6; with lfe, 4 or 6, the last of them the LFE channel), at 48 kHz and kbps kb/s.
Channels are given in AC-3's order: L, C, R, Ls, Rs (as many as there are: L, R for stereo; L, C, R; L, R, Ls, Rs), then LFE.
func (*Encoder) EncodeFrame ¶
EncodeFrame codes FrameSamples samples of each channel (in [-1, 1], AC-3 order) as one frame.