UpdateMusic
From OxeyeWiki
|
audio.updateMusic(musicFilename , volume) | ||
|
Updates a music already playing started by audio.playMusic. | ||
| Parameter | Expected Type | Description |
| musicFilename | A string | The name of the music file, relative to the source folder. The name is case sensitive on Mac OS X. |
| volume | A number | Volume of the played music file, maximum is 1. |
| Returns | ||
|
Returns true is the sound was updated, false if the sound is no longer playing or could not be found. | ||
| Daisymoon Audio Lib |
|---|
Example
-- start of game
audio.playMusic("intro.ogg")
-- during loop:
if not audio.updateMusic("intro.ogg", 0.5) then
if not audio.updateMusic("level.ogg", 1) then
audio.playMusic("level.ogg")
end
end