Skip to content

md-audio

[module] md-audio

Types

PCM WAV file handling

[procedure] (raw->audio DATA CHANNELS RATE SAMPLE-LENGTH SIGNEDNESS ENDIANNESS)

Convert raw (headerless) PCM WAV data into an audio structure. SAMPLE-LENGTH is the number of bytes used by one sample in one channel.

[procedure] (import-raw FILENAME #!optional (CHANNELS 1) (RATE 44100) (SAMPLE-LENGTH 1) (SIGNEDNESS 'unsigned) (ENDIANNESS 'little))

Construct an audio structure from a raw (headerless) PCM audio file.

[procedure] (import-pcm-wav FILENAME)

Construct an audio structure from a PCM WAVE (RIFF) file.

[procedure] (audio->raw AUDIO BITS-PER-SAMPLE SIGNEDNESS ENDIANNESS)

[procedure] (audio->pcm-wav AUDIO BITS-PER-SAMPLE)

Extract raw PCM audio from the audio structure AUDIO.

[procedure] (export-pcm-wav FILENAME AUDIO BITS-PER-SAMPLE)

Export the audio structure AUDIO to the PCM WAV file FILENAME, using a bit depth of BITS-PER-SAMPLE.

[procedure] (normalize AUDIO)

Normalize the range of the audio structure AUDIO to (-1.0, 1.0)

[procedure] (resample AUDIO TARGET-RATE #!optional (WINDOW-SIZE 44))

Resample AUDIO to the sample rate TARGET-RATE using Blackman windowed interpolation. Optionally, WINDOW-SIZE may specify the number of samples used by the Blackman window function for interpolation.