Music
Music controls the single global CD-XA stream. Import a PCM WAV with
Streaming Music (CD-XA) enabled, then use its filename stem.
| Method | Returns | Description |
|---|---|---|
Music.Play(name[, loop]) | boolean | Starts a registered stream; loop defaults to the runtime behavior. |
Music.Stop() | boolean | Stops the active stream. |
Music.SetVolume(volume) | boolean | Sets normalized stream volume. |
Music.IsPlaying() | boolean | Reads 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.