Skip to main content

Module cdaudio

Module cdaudio 

Source
Expand description

Red Book CD audio: extracts music tracks from the user’s own disc image (CUE/BIN) into TRACKnn.WAV files, which OpenBlood then plays as level music.

Structs§

CueTrack

Constants§

SECTOR 🔒

Functions§

extract
extract_dir
Reads the ISO 9660 filesystem of the disc’s data track (raw 2352-byte sectors) and copies the files of dir (e.g. MOVIE, Blood’s cutscenes) to out. Returns the names copied.
load_wav
msf 🔒
parse_cue
Parses a single-file CUE sheet. Returns the BIN path and the tracks.
stream_wav
Loads a 16-bit stereo 44.1 kHz WAV as interleaved f32 samples. Streams the PCM data of a 16-bit WAV file in half-second chunks of interleaved samples, looping forever, from a background thread. Only a few chunks are buffered (the channel is bounded), so memory stays small and nothing large is allocated at level start. The thread exits when the receiver is dropped.
write_wav
Writes 16-bit stereo 44.1 kHz PCM bytes as a WAV file.