Easy Audio ยป FLAC

To read and decode FLAC file or stream you need to follow these steps:
  1. Open a FLAC file/Get a stream with element type (unsigned-byte 8).
  2. Pass the stream to flac:open-flac function which will create and return bitreader:reader object. This object allows easy-audio library to read not just octets, but any amount of bits from audio stream.
  3. Read metadata blocks from the stream, passing the object from previous step to flac:read-metadata.
  4. Do whatever you want with metadata and read the first audio frame with flac:read-frame.
  5. Decode the frame with flac:frame-decode and repeat previous step until all data is read and decoded.
NB: You can reduce consing when reading frames by binding flac:*out-buffers* variable with buffers returned by flac:make-output-buffers.

API

Conditions.
No node with name flac-error.
No node with name flac-bad-metadata.
No node with name flac-bad-frame.
Metadata blocks. Please note, that slot accessors are not documented here, but usually available by scheme CLASSNAME-SLOTNAME.
No node with name streaminfo.
No node with name seektable.
No node with name seekpoint.
No node with name vorbis-comment.
No node with name cuesheet.
No node with name picture.
Working with audio frames.
No node with name frame.
No node with name read-frame.
No node with name frame-decode.
Other functions / helpers.
No node with name open-flac.
No node with name read-metadata.
No node with name seek-sample.
No node with name metadata-find-seektable.
No node with name make-output-buffers.
No node with name with-output-buffers.
It also can decode FLAC data from OGG container. There are flac:open-ogg-flac, flac:read-ogg-metadata and flac:read-ogg-frame functions for that purpose. Seeking does not work with OGG container.