2026-06-08 13:16:21 +02:00
2026-06-08 12:17:03 +02:00
2026-06-08 13:16:21 +02:00
2026-06-08 13:16:21 +02:00
2026-06-08 13:16:21 +02:00
2026-06-08 12:17:03 +02:00
2026-06-08 10:27:05 +02:00
2026-06-08 12:14:32 +02:00
2026-06-08 09:03:31 +02:00
2026-05-18 16:36:19 +02:00
2026-06-08 12:14:32 +02:00
2026-05-04 12:05:02 +02:00
2026-06-05 22:17:10 +02:00
2026-05-19 15:10:28 +02:00
2026-06-08 13:16:21 +02:00
2026-06-08 13:16:21 +02:00

racket-audio

Integration of common audio libraries in Racket.

The package contains decoder, player and encoder bindings. Playback uses the existing audio player modules. Encoding is provided by audio-encoder.rkt with Opus and FLAC backends.

Native dependencies

For playback and decoding, install the native libraries used by the selected backends:

  • libao
  • libFLAC
  • mpg123
  • FFmpeg libraries, including libavutil, libavcodec, libavformat and libswresample

For encoding, also install:

  • libopusenc
  • libopus
  • libogg
  • TagLib with the C binding, usually provided as taglib / taglib_c

The Opus encoder backend uses libopusenc directly. The FLAC encoder backend uses libFLAC directly. FLAC sample-rate conversion uses the existing FFmpeg swresample layer.

macOS

Using Homebrew, install the native libraries before using the package:

brew install libao
brew install flac
brew install mpg123
brew install ffmpeg
brew install opus
brew install libopusenc
brew install taglib

Some Homebrew installations provide FFmpeg as ffmpeg; older local setups may use ffmpeg-full.

Encoder examples

Encode to Opus:

(require "audio-encoder.rkt")

(audio-encode "input.flac"
              "output.opus"
              (hash 'bitrate 224000
                    'vbr? #t
                    'complexity 10)
              #:encoder 'opus)

Encode 96 kHz FLAC to 48 kHz FLAC:

(audio-encode "input-96k.flac"
              "output-48k.flac"
              (hash 'sample-rate 48000
                    'bits-per-sample 24
                    'compression-level 8)
              #:encoder 'flac)

A small test wrapper is available in encoder-test.rkt:

racket encoder-test.rkt --encoder opus --input input.flac --output output.opus --bitrate-kbps 224
racket encoder-test.rkt --encoder flac --input input-96k.flac --output output-48k.flac --sample-rate 48000
S
Description
Integration of common audio libraries in racket
Readme GPL-2.0 866 KiB
Languages
Racket 100%