Documentation
¶
Overview ¶
Package flac decodes a FLAC stream into PCM samples, with the standard library only. It is test-data tooling: cmd/speech-testdata uses it to turn LibriSpeech's FLAC files into WAVE files without ffmpeg or a dependency.
It decodes every subframe type (constant, verbatim, fixed, LPC), wasted bits, both residual coding methods with escaped partitions, and the stereo decorrelation modes, checks each frame header's CRC-8 and each frame's CRC-16, and checks the decoded audio against the stream's MD5 signature. Metadata blocks other than STREAMINFO are skipped.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrFormat = errors.New("flac: invalid stream")
ErrFormat means the stream is not valid FLAC or uses something this decoder does not support.
var ErrIntegrity = errors.New("flac: integrity check failed")
ErrIntegrity means a frame's CRC or the stream's MD5 signature does not match.
Functions ¶
This section is empty.
Types ¶
type Stream ¶
type Stream struct {
Info StreamInfo
// Samples holds one slice per channel, each Info.TotalSamples long.
Samples [][]int32
}
Stream is a decoded FLAC stream.