AVAudioPlayer and fadeout problem only on iPad
AVAudioPlayer and fadeout problem only on iPad
- Subject: AVAudioPlayer and fadeout problem only on iPad
- From: uɐıʇəqɐz pnoqɥɒɯ <email@hidden>
- Date: Tue, 6 Apr 2010 12:37:26 -0700
Hi. I have an iPad app that uses AVAudioPlayer and my own fadeout method. On the Simulator, the sounds are played back beautifully, and the same with the iPhone/iPod Touches. However on the actual iPad I am seeing two problems. The first problem is that if two notes are played close enough to each other, I get a small noise spike in between the two:
http://files.me.com/mahboud/rvthbh
The last three pairs of notes have a small peak in the middle where the noise is heard. The audio file for this can be found at:
http://files.me.com/mahboud/klywar.mp3
My next problem is that the actual fadeout sounds sort of crackly or noisy. Listen to the end of the each of the two notes here for the bzzt or crackle:
http://files.me.com/mahboud/zxcjst.mp3
And here is my code for doing the fadeout:
- (void) fadeOutVolume:(AVAudioPlayer *) player;
{
if (![player isPlaying])
return;
if (player.volume > 0.05) {
player.volume = player.volume - 0.05;
[self performSelector:@selector(fadeOutVolume:) withObject:player afterDelay:sustainDelay];
} else if (player.volume > 0.00){
player.volume = 0.00;
[self performSelector:@selector(fadeOutVolume:) withObject:player afterDelay:sustainDelay];
}
else {
[player stop];
[self audioPlayerDidFinishPlaying:player successfully:YES];
}
}
Does anyone know how I can avoid these two issues? Should I fadeout a different way? Should I not use AVAudioPlayer? Is this a bug I should file with Apple?
Thanks in advance.
-mahboud _______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden