Hi, I’m using Cocos2dx 3.17.2 with AudioEngine in my game and i’m having some App Not Responding (ANR) warnings in Firebase Crashlytics as shown below.
Crashlytics points to the line where I stop background music before start playing new background music.
Here’s the code that causes problem.
AudioEngine::stop(backgroundMusic); // ANR Happens Here In
backgroundMusic = AudioEngine::play2d(StringUtils::format("Sounds/BackgroundMusic/%d.mp3", gameAreaName), true, volumeBGMusic);
As far as I know AudiEngine::stop(backgroundMusic)
triggers cocos2d: experimental:UrlAudioPlayer:stop0
and that leads to ANR.
Am I doing something wrong? Any help or directions in help would be appreciated.
Thank You For Your Time.