Skip to main content

Music

Music controls the single global CD-XA stream. Import a PCM WAV with Streaming Music (CD-XA) enabled, then use its filename stem.

MethodReturnsDescription
Music.Play(name[, loop])booleanStarts a registered stream; loop defaults to the runtime behavior.
Music.Stop()booleanStops the active stream.
Music.SetVolume(volume)booleanSets normalized stream volume.
Music.IsPlaying()booleanReads stream state.
function Start(gameObjectId)
Music.SetVolume(0.75)
if not Music.Play("title_theme", true) then
Log.Print("title_theme is unavailable")
end
end

A build can register up to eight streaming tracks and play one at a time. Music uses the CD-ROM path rather than resident VAG sample memory. Scene loading can temporarily suspend the stream. See Audio Import.

The PS1 stream clock follows elapsed VBlanks, independently of render FPS. After a scene-data load, resuming the suspended track restarts it from the beginning; seamless or sample-accurate continuation is not provided.