AVAudioPlayer skipping when returning from Springboard
I have audio constantly playing during my application. I am having some odd behavior when I press the button to return to Springboard then resume my applications. The Audio will continue playing but will skip/cutout every half second or so. Pausing and resuming the audio seems to have no effect.
I am using AVAudioPlayers to play my Audio. Here is the code to play them...
player = [[AVAudioPlayer alloc] initWithData:data error:&err];
[player play];
player.numberOfLoops = loops;
mSimpleSoundList.push_back(player);
Then in the "applicationWillResignActive" I call...
const uint32 size = mSimpleSoundList.size();
for(unsigned int i = 0; i < size; ++i) {
AVAudioPlayer* curElement = mSimpleSoundList.at(i);
[curElement pause];
}
followed by this code on restart..
const uint32 size = mSimpleSoundList.size();
for(unsigned int i = 0;开发者_C百科 i < size; ++i) {
AVAudioPlayer* curElement = mSimpleSoundList.at(i);
[curElement play];
}
Turn out to be an AudioUnits fault.
AudioUnits causing universal skipping after returning from Springboard
精彩评论