Expand description
The Playdate’s sounds and music, baked for pdc: every sound file of the
audio the game ships there, and each of its music tracks, decoded (OGG
Vorbis or WAV), mixed down to mono and written as an IMA ADPCM WAV at its
own 44.1 kHz, under BAKED_SOUND_DIR and BAKED_MUSIC_DIR, where
shuyi-playdate opens them. pdc turns each into a .pda.
Decoding music takes seconds, so each file made is kept in the build’s
cache under its source’s checksum, in a folder named after FORMAT, so a
new conversion never reuses an old file.
Structs§
- Job
- One file to bake.
Constants§
- BLOCK_
BYTES - Bytes in one ADPCM block: what both tools the SDK’s docs name (ffmpeg’s
adpcm_ima_wavand Audacity) write for mono at 44.1 kHz, so it is whatpdcis known to read. - BLOCK_
SAMPLES - Samples in one mono block: the one in its header, then two a byte.
- FORMAT
- The conversion’s version: the cache folder is named after it, so a change to what is written must change it.
Functions§
- adpcm_
wav samples(mono,SAMPLE_RATE) as an IMA ADPCM WAV file: blocks ofBLOCK_BYTES, the last padded with silence, and afactchunk with the real number of samples, to whichpdctrims it, so a looped track loops with no gap.- bake
- Bakes
jobsintointo, through the cache incache, which holds each result under its source’s checksum and length. - cache_
dir - The cache of baked files under the build’s folder
build. - decode
- The mono samples of the audio file
bytesnamedname(.wav, or else OGG Vorbis), atSAMPLE_RATE: a stereo file’s channels are averaged. - jobs
- The files to bake of what the game ships: each sound file once, unless the
build leaves it out, and the file of each music cue, read from
root’s music folder where the game doesn’t read them itself. Two files that would land on one path are an error, and so is a file that can’t be read.