Expand description
XA-ADPCM music: stream one channel of an interleaved XA file through the drive’s own decoder to the SPU’s CD input.
The encoder side is psx-audio-cook xa-encode; docs/XA-MUSIC.md has the
workflow. A song file holds several songs as interleaved channels (every
fourth sector for four 37.8 kHz stereo songs at single speed). With
XA-ADPCM and the file/channel filter switched on, the drive hands the
sectors of the chosen channel to its decoder and drops the rest; the CPU
never sees the audio.
§The drive is busy while music plays
Music is a read: the drive streams the file continuously, so the CPU
cannot read data from the disc meanwhile, not even at the same time at the
same speed (the laser follows the file, not the data). Load first, then
start the song, or lend the drive for the load with
Player::with_cd_suspended and Player::resume afterwards (a seek
back to where the song was), or stop it and start it again (it restarts
from the top). Streaming data and music together needs the data
interleaved into the filler slots of the song file, which this player does
not do.
§Polling
The player is poll-driven like super::audio: call Player::poll
about once per frame. It asks the drive where the head is, and when the
head reaches the end of the song file it either restarts the file
(looping) or pauses the drive. A restart is a seek, so a loop has an
audible gap whose length is the drive’s seek time; authoring the loop
point into a quiet passage hides it.
Structs§
- File
- An interleaved XA file on the disc.
- Head
Sample - One reading of the drive head inside the playing song, taken by
Player::poll. - Pause
Refused - The drive refused Pause, as it does during the seek at the start of a read. Keep polling and try again.
- Player
- Plays XA-ADPCM songs. Owns the CD token: nothing else drives the controller while a player exists.
- Song
- One channel of an
File.
Enums§
- Drive
Speed - Speed the song file was interleaved for (
psx-audio-cook xa-encode --speed). - Error
- The step of starting a song that the drive refused.
- Event
- What
Player::pollsaw.
Constants§
- COMMAND_
SPINS - Per-command response spin budget: generous, the drive answers far sooner.