First of all i know this is a programming forums, but my problem concerns Xcode and the problem happens with me while CODING.
When i use Xcode, when it is stopped in breakpoints while debugging the sound of the music played ( in my Mac music player ) is gone !!! i know this is awkward but it happens. Does any one has a solution or at least a reason for this?
After googling this problem i just found one case talking about the same problem here in this Link
I'm not using Spotify like the case in the link i'm using another music player called Vox
I have changed Vox and changed it with Deezer and it has the same problem
Update 1
As mentioned in the Accepted Answer, This problem only happened while using Cocos2dx in Xcode, When i returned back to the use Xcode with just iOS sdk without the Cocos2dx this problem doesn't exist any more.
Give your system a reset If you're having a pausing problem consistently, what you want to do is turn off your phone, and wait about 15 seconds, and then turn it back on. Whether this is an android or iPhone device, this always is a helpful way to just give your system a reset and try again.
This is happening when your capture audio session in your application and debug something.
The case to reproduce this using Xcode + simulator (on device you will have phone's audio session, so it can not be reproduced with the following snippet). Sometimes it stops just after breakpoint occurs, sometimes - after about a minute (i think, session expires after that time, or something like that)
Create empty project and override didFinishLaunchingWithOptions
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
NSError *setCategoryError = nil;
[[AVAudioSession sharedInstance] setCategory: AVAudioSessionCategoryPlayback error: &setCategoryError];
if (setCategoryError) // set breakpoint here
NSLog(@"Error setting category! %@", setCategoryError);
return YES;
}
I think, on breakpoint session somehow stops music playing. so - check your project for the code, which manipulates with audio session (AVAudioSession). Hope, this helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With