To stop the background Music after pressing "PlayGame" button in cocos2d-android, have given like SoundEngine.sharedEngine().playSound(context, R.raw.rock, true);
since i could not find code for stop background music, i have given pause method, once i resume the game again the music starts, but i need to abort the music after splashscreen itself, I have search but could not find for cocos2d-android game engine, please do help me.
Asked
Active
Viewed 544 times
-3

DD.
- 973
- 2
- 10
- 32
1 Answers
0
On the press of Play Button use below line :
SoundEngine.sharedEngine().pauseSound();

Akarsh M
- 1,629
- 2
- 24
- 47
-
i had used pauseSound();, but this did not workout perfectly, if game restarts again Background Music gets started, but i should not get like this @AM – DD. Aug 09 '13 at 08:10
-
where are you calling the background sound ? – Akarsh M Aug 09 '13 at 08:37
-
In splashScreen as SoundEngine.sharedEngine().playSound(context, R.raw.rock, true);, i need sound only for splash and not for the next layer @AM – DD. Aug 09 '13 at 09:19
-
you are using the splash Screen in Activity or Using some trick in CCLayer look like splash screen ? – Akarsh M Aug 09 '13 at 09:30
-
if you have onExit() method where you are using the splash screen . put above line of code into the onExit() method – Akarsh M Aug 09 '13 at 09:32