Window::playMusic()
Plays background music on a loop. It keeps playing when the stage changes, and only one track plays at a time: a new one replaces the old, and the track that is already playing plays on (so every stage may ask for its music). Long Ogg files are streamed, so a song of several minutes costs little memory.
Examples
Syntax
Java
.playMusic(path)
.playMusic(path, seconds)
Parameters
| Name | Data Type | Description |
|---|---|---|
| path | String | a WAV or OGG file, e.g. `"assets/theme.ogg"`, or a built-in sound's name |
| seconds | double | how long the old track fades out while the new one fades in |
Return
void