Skip to content

Shirakumo/cl-vorbis

Repository files navigation

## About
This is a small library wrapping stb_vorbis to provide a fast, libre, and easy-to-ship OGG/Vorbis decoder.

## How To
For this tutorial we assume that ``org.shirakumo.fraf.vorbis`` has a local nickname of ``vorbis``.

:: common lisp
(vorbis:with-file (file "test.ogg")
  (values (vorbis:channels file)
          (vorbis:samplerate file)
          (vorbis:decode-frame file)))
::

There's functions to decode a full frame (``decode-frame``), return the pointers to a decoded frame (``decode-frame-ptrs``), decode samples to a list of buffers (``decode``), and decode to an interleaved buffer (``decode-interleaved``).

If need-be, you can also access the underlying C functions directly through the ``org.shirakumo.vorbis.cffi`` package and the ``handle`` function.

## Pinnable Vectors
Where mentioned, a "pinnable vector" must be either a vector allocated through ``static-vectors``, or on SBCL a vector of type ``sb-kernel:simple-unboxed-array``.

## Included Sources
- "stb_vorbis.c"(https://github.com/nothings/stb/blob/master/stb_vorbis.c)
- "glibc-2.13.h"(https://github.com/wheybags/glibc_version_header/blob/master/version_headers/x64/force_link_glibc_2.13.h)