UpdateMusic

From OxeyeWiki

(Difference between revisions)
Jump to: navigation, search
Thewreck (Talk | contribs)
(Created page with '{{AudioMethod | audio.updateMusic(musicFilename , volume) | Updates a music already playing started by audio.playMusic. | {{MethodParam|musicFilename|A string|The name of the...')
Newer edit →

Revision as of 13:50, 18 January 2010

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
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox