background music

hi all.
I want to play background music on all scenes. I am loading into a variable music in main.lua

  FonMuz = audio.loadSound("Spirit.mp3")

In the game scene, I play music and it plays continuously on all stages

   audio.play(FonMuz)

In the end scene I want to stop the music but it won’t stop

   audio.stop( FonMuz )
   audio.dispose(FonMuz)

audio.stop() does not take the audio handle for reference. It stops the audio channel the sound is playing on.

Sample here.

I think for music its better to use audio.loadStream
and you stop it by disposing it

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.