Next: Introduction, Previous: (dir), Up: (dir) [Contents][Index]
This is the cl-flac Reference Manual, version 1.0.0, generated automatically by Declt version 3.0 "Montgomery Scott" on Sun May 15 03:46:23 2022 GMT+0.
• Introduction | What cl-flac is all about | |
• Systems | The systems documentation | |
• Files | The files documentation | |
• Packages | The packages documentation | |
• Definitions | The symbols documentation | |
• Indexes | Concepts, functions, variables and data types |
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:
(ql:quickload :cl-flac)
Create a new file
object:
(defvar *file* (cl-flac:make-file #p"~/my-cool-music.flac"))
You can query the file information with samplerate
, channels
, sample-count
, frame-count
, and bits-per-sample
.
Reading samples from the file happens with read-directly
, read-into-vector
, or 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 close-file
.
A complete test that allows you to play back a flac file is included in test.lisp
Next: Files, Previous: Introduction, Up: Top [Contents][Index]
The main system appears first, followed by any subsystem dependency.
• The cl-flac system |
Nicolas Hafner <shinmera@tymoon.eu>
Nicolas Hafner <shinmera@tymoon.eu>
(:git "https://github.com/shirakumo/cl-flac.git")
zlib
Bindings to libflac, a simple FLAC decoding library
1.0.0
cl-flac.asd (file)
Files are sorted by type and then listed depth-first from the systems components trees.
• Lisp files |
• The cl-flac.asd file | ||
• The cl-flac/package.lisp file | ||
• The cl-flac/low-level.lisp file | ||
• The cl-flac/wrapper.lisp file | ||
• The cl-flac/documentation.lisp file |
Next: The cl-flac/package․lisp file, Previous: Lisp files, Up: Lisp files [Contents][Index]
cl-flac.asd
cl-flac (system)
Next: The cl-flac/low-level․lisp file, Previous: The cl-flac․asd file, Up: Lisp files [Contents][Index]
cl-flac (system)
package.lisp
Next: The cl-flac/wrapper․lisp file, Previous: The cl-flac/package․lisp file, Up: Lisp files [Contents][Index]
package.lisp (file)
cl-flac (system)
low-level.lisp
Next: The cl-flac/documentation․lisp file, Previous: The cl-flac/low-level․lisp file, Up: Lisp files [Contents][Index]
low-level.lisp (file)
cl-flac (system)
wrapper.lisp
Previous: The cl-flac/wrapper․lisp file, Up: Lisp files [Contents][Index]
wrapper.lisp (file)
cl-flac (system)
documentation.lisp
Next: Definitions, Previous: Files, Up: Top [Contents][Index]
Packages are listed by definition order.
• The cl-flac package | ||
• The cl-flac-cffi package |
Next: The cl-flac-cffi package, Previous: Packages, Up: Packages [Contents][Index]
package.lisp (file)
org.shirakumo.fraf.flac
common-lisp
Previous: The cl-flac package, Up: Packages [Contents][Index]
package.lisp (file)
org.shirakumo.fraf.flac.cffi
Definitions are sorted by export status, category, package, and then by lexicographic order.
• Exported definitions | ||
• Internal definitions |
Next: Internal definitions, Previous: Definitions, Up: Definitions [Contents][Index]
• Exported functions | ||
• Exported structures |
Next: Exported structures, Previous: Exported definitions, Up: Exported definitions [Contents][Index]
Returns the number of bits per sample as encoded in the file.
See FILE
wrapper.lisp (file)
low-level.lisp (file)
Returns the number of channels that the file encodes.
See FILE
wrapper.lisp (file)
low-level.lisp (file)
Explicitly close the file.
Note that this will render the instance useless.
See FILE
wrapper.lisp (file)
Returns the number of frames stored in the file.
This is the number of samples divided by the number
of channels, this giving the number of frames.
See SAMPLE-COUNT
See FILE
wrapper.lisp (file)
low-level.lisp (file)
low-level.lisp (file)
Accessor to the handle for the underlying C data of the FLAC file.
See FILE
wrapper.lisp (file)
(setf handle) (function)
wrapper.lisp (file)
handle (function)
Create a new FLAC file from the given path.
If the path is not accessible, or the file is malformatted,
an error is signalled.
See FILE
wrapper.lisp (file)
low-level.lisp (file)
Directly decode samples from the file into the buffer.
BUFFER-SIZE is in number of bytes, but must be aligned
with the sample size. The buffer is filled with 32-bit
float samples.
Returns the number of bytes successfully read. If this
number is lower than the requested amount, the file has
reached its end.
See FILE
wrapper.lisp (file)
low-level.lisp (file)
Decode samples into the vector.
The vector must have an element-type of either SINGLE-FLOAT, (SIGNED-BYTE 16), or (SIGNED-BYTE 32).
Returned is the number of samples that were actually
decoded, as that might be lower than the requested
amount if the file does not contain enough samples
anymore.
See FILE
wrapper.lisp (file)
low-level.lisp (file)
low-level.lisp (file)
Reads the given number of samples into a single-float vector.
Returns the vector and the number of samples that were
actually decoded.
See READ-INTO-VECTOR
See FILE
wrapper.lisp (file)
Returns the total number of samples stored in the file.
See FRAME-COUNT
See FILE
wrapper.lisp (file)
low-level.lisp (file)
low-level.lisp (file)
Returns the samplerate of the file in Hertz.
See FILE
wrapper.lisp (file)
Seek to the requested frame.
Returns the file on success, signals a condition on
failure.
See FILE
wrapper.lisp (file)
low-level.lisp (file)
low-level.lisp (file)
Previous: Exported functions, Up: Exported definitions [Contents][Index]
Container for the FLAC file.
Note that you do not need to explicitly close the file.
It will automatically clean up when this instance is
garbage collected.
See MAKE-FILE
See CLOSE-FILE
See HANDLE
See PATH
See CHANNELS
See SAMPLERATE
See BITS-PER-SAMPLE
See SAMPLE-COUNT
See FRAME-COUNT
See READ-DIRECTLY
See READ-INTO-VECTOR
See READ-TO-VECTOR
See SEEK
wrapper.lisp (file)
structure-object (structure)
print-object (method)
pathname
path (function)
(setf path) (function)
cffi-sys:foreign-pointer
handle (function)
(setf handle) (function)
Previous: Exported definitions, Up: Definitions [Contents][Index]
• Internal special variables | ||
• Internal macros | ||
• Internal functions | ||
• Internal generic functions | ||
• Internal conditions |
Next: Internal macros, Previous: Internal definitions, Up: Internal definitions [Contents][Index]
low-level.lisp (file)
low-level.lisp (file)
Next: Internal functions, Previous: Internal special variables, Up: Internal definitions [Contents][Index]
Defines a wrapper function that just returns what the inner C function returns.
wrapper.lisp (file)
Checks the returned code for error-ness and signals a condition if applicable.
See FLAC-ERROR
wrapper.lisp (file)
Next: Internal generic functions, Previous: Internal macros, Up: Internal definitions [Contents][Index]
wrapper.lisp (file)
wrapper.lisp (file)
wrapper.lisp (file)
Returns the path namestring that was used to read the file.
See FILE
wrapper.lisp (file)
Next: Internal conditions, Previous: Internal functions, Up: Internal definitions [Contents][Index]
Returns the error code encapsulated in the condition.
See FLAC-ERROR
(setf code) (generic function)
wrapper.lisp (file)
code (generic function)
wrapper.lisp (file)
Previous: Internal generic functions, Up: Internal definitions [Contents][Index]
This condition is signalled when an error in the underlying library is detected.
See CODE
wrapper.lisp (file)
error (condition)
:code
code (generic function)
(setf code) (generic function)
Previous: Definitions, Up: Top [Contents][Index]
• Concept index | ||
• Function index | ||
• Variable index | ||
• Data type index |
Next: Function index, Previous: Indexes, Up: Indexes [Contents][Index]
Jump to: | C F L |
---|
Jump to: | C F L |
---|
Next: Variable index, Previous: Concept index, Up: Indexes [Contents][Index]
Jump to: | %
(
B C D F G H M O P R S W |
---|
Jump to: | %
(
B C D F G H M O P R S W |
---|
Next: Data type index, Previous: Function index, Up: Indexes [Contents][Index]
Jump to: | *
C H P S |
---|
Jump to: | *
C H P S |
---|
Previous: Variable index, Up: Indexes [Contents][Index]
Jump to: | C F P S |
---|
Jump to: | C F P S |
---|