-
Notifications
You must be signed in to change notification settings - Fork 7.1k
Open
Description
- cocos2d-x version: 3.17
- devices test on: Android & iOS
Steps to Reproduce:
- Create a simple example with 2 scenes: MainScene and GameScene. Use
replaceScene
for swtich between scenes. - In MainScene, call this methods:
AudioEngine::stopAll();
AudioEngine::play2d("sounds/music.mp3", true, 0.3f);
Where music is some mp3 random file.
And put a button for switch to GameScene.
- In GameScene put a button for go back to MainScene.
Ok, now, try the following:
- Open the game. "MainScene" is the current scene and the sound works perfect.
- Touch the button for switch to "GameScene". The sound continues working.
- Now, touch the button for switch to "MainScene" again. The sound stops and it doesn't work anymore.
I had this problem only in Android (in iOS works perfect) and using a mp3 file. I resolved this issue replacing the mp3 with a .wav file. Something are working wrong in Android using AudioEngine and mp3 files.
Metadata
Metadata
Assignees
Labels
No labels