Bindings to libflac, a simple FLAC decoding library
This is a bindings library to libflac, a simple library for decoding FLAC files.
Precompiled versions of the underlying library are included in this. If you want to build it manually however, refer to the libflac page.
Load the system through ASDF or Quicklisp:
Create a new
(defvar *file* (cl-flac:make-file #p"~/my-cool-music.flac"))
You can query the file information with
Reading samples from the file happens with
read-to-vector. A basic playback loop could look like this:
(loop with buffer = (make-array 512 :element-type 'single-float) for samples = (cl-flac:read-into-vector *file* buffer) until (= 0 samples) do (process-buffer-somehow buffer))
When you're done with the file, you can either just let it be GCd or close it explicitly with
A complete test that allows you to play back a flac file is included in test.lisp