Skip to content

AudioEngine Android mp3 problem #20447

@raz0r007

Description

@raz0r007
  • cocos2d-x version: 3.17
  • devices test on: Android & iOS

Steps to Reproduce:

  1. Create a simple example with 2 scenes: MainScene and GameScene. Use replaceScene for swtich between scenes.
  2. 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.

  1. In GameScene put a button for go back to MainScene.

Ok, now, try the following:

  1. Open the game. "MainScene" is the current scene and the sound works perfect.
  2. Touch the button for switch to "GameScene". The sound continues working.
  3. 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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions