-
-
Notifications
You must be signed in to change notification settings - Fork 253
Closed
Labels
bugSomething isn't workingSomething isn't workingcocos2dxThe issue present in original cocos2dxThe issue present in original cocos2dx
Milestone
Description
- axmol version: 2.3.2
- devices test on: iPhone
- developing environments
- Xcode version: 16.2
- cmake version: 3.31.5
On iOS, if I play background music using AudioEngine::play2d, then send the app to the background and change the audio route (e.g., from speaker to headphones or vice versa), the audio does not resume when returning to the app.
In this situation, the following log message appears:
AURemoteIO.cpp:1666 AUIOClient_StartIO failed
Steps to Reproduce:
- Start playing audio using AudioEngine::play2d("bgm.mp3").
- Send the app to the background.
- Switch the audio output (e.g., plug in or unplug headphones).
- Return to the app.
The background music is no longer audible.
Workaround:
If I comment out the following lines in AudioEngineImpl.cpp, the issue no longer occurs:
else if ([notification.name isEqualToString:AVAudioSessionRouteChangeNotification])
{ // replay
//// ccALPauseDevice();
//// ccALResumeDevice();
}
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingcocos2dxThe issue present in original cocos2dxThe issue present in original cocos2dx