Documentation ¶
Overview ¶
Package flac provides access to FLAC (Free Lossless Audio Codec) streams.
A brief introduction of the FLAC stream format [1] follows. Each FLAC stream starts with a 32-bit signature ("fLaC"), followed by one or more metadata blocks, and then one or more audio frames. The first metadata block (StreamInfo) describes the basic properties of the audio stream and it is the only mandatory metadata block. Subsequent metadata blocks may appear in an arbitrary order.
Please refer to the documentation of the meta [2] and the frame [3] packages for a brief introduction of their respective formats.
[1]: https://www.xiph.org/flac/format.html#stream [2]: https://godoc.org/gopkg.in/mewkiz/flac.v1/meta [3]: https://godoc.org/gopkg.in/mewkiz/flac.v1/frame
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Stream ¶
type Stream struct { // The StreamInfo metadata block describes the basic properties of the FLAC // audio stream. Info *meta.StreamInfo // Zero or more metadata blocks. Blocks []*meta.Block // contains filtered or unexported fields }
A Stream contains the metadata blocks and provides access to the audio frames of a FLAC stream.
ref: https://www.xiph.org/flac/format.html#stream
func New ¶
New creates a new Stream for accessing the audio samples of r. It reads and parses the FLAC signature and the StreamInfo metadata block, but skips all other metadata blocks.
Call Stream.Next to parse the frame header of the next audio frame, and call Stream.ParseNext to parse the entire next frame including audio samples.
func Open ¶
Open creates a new Stream for accessing the audio samples of path. It reads and parses the FLAC signature and the StreamInfo metadata block, but skips all other metadata blocks.
Call Stream.Next to parse the frame header of the next audio frame, and call Stream.ParseNext to parse the entire next frame including audio samples.
Note: The Close method of the stream must be called when finished using it.
func Parse ¶
Parse creates a new Stream for accessing the metadata blocks and audio samples of r. It reads and parses the FLAC signature and all metadata blocks.
Call Stream.Next to parse the frame header of the next audio frame, and call Stream.ParseNext to parse the entire next frame including audio samples.
func ParseFile ¶
ParseFile creates a new Stream for accessing the metadata blocks and audio samples of path. It reads and parses the FLAC signature and all metadata blocks.
Call Stream.Next to parse the frame header of the next audio frame, and call Stream.ParseNext to parse the entire next frame including audio samples.
Note: The Close method of the stream must be called when finished using it.
func (*Stream) Close ¶
Close closes the stream if opened through a call to Open or ParseFile, and performs no operation otherwise.