Documentation
¶
Overview ¶
Package flac decodes FLAC audio streams to raw interleaved PCM at native bit depth.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrBitDepth is returned when a FLAC stream has an unsupported bit depth. ErrBitDepth = errors.New("unsupported bit depth") // ErrReadFailure is returned when reading from the FLAC stream fails. ErrReadFailure = errors.New("read failure") )
Functions ¶
Types ¶
type BitDepth ¶
type BitDepth uint
BitDepth represents the bit depth of PCM audio samples.
const ( Depth4 BitDepth = 4 Depth8 BitDepth = 8 Depth12 BitDepth = 12 Depth16 BitDepth = 16 Depth20 BitDepth = 20 Depth24 BitDepth = 24 Depth32 BitDepth = 32 )
Standard PCM bit depths.
func (BitDepth) BytesPerSample ¶
BytesPerSample returns the number of bytes needed to store one sample. Sub-byte depths (4-bit) are stored in 1 byte (sign-extended). 12-bit samples are stored in 2 bytes (sign-extended to 16-bit). 20-bit samples are stored in 3 bytes (sign-extended to 24-bit).
type Decoder ¶
type Decoder struct {
// contains filtered or unexported fields
}
Decoder streams decoded PCM from a FLAC source.
func NewDecoder ¶
func NewDecoder(rs io.ReadSeeker) (*Decoder, error)
NewDecoder opens a FLAC stream and returns a streaming decoder. The caller should call Close when done.
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
flac-example-decoder
command
flac-example-decoder decodes a FLAC file to WAV or raw PCM on stdout.
|
flac-example-decoder decodes a FLAC file to WAV or raw PCM on stdout. |
|
Package version holds build-time metadata injected via ldflags.
|
Package version holds build-time metadata injected via ldflags. |
Click to show internal directories.
Click to hide internal directories.