开发者

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜