Take the 2-minute tour ×

I'm playing short aiff sounds using the AVAudioPlayer class while doing animations. Unfortunately, every time a sound plays the frame rate of the animation drops. It seems this can be fixed by setting the AVAudioSession category to AVAudioSessionCategorySoloAmbient, but despite having done this, I'm still seeing a lot of frame rate drops.

I'm settings the AVAUdioSession category in the app delegate like this:

NSError *setCategoryError = nil;
BOOL success = [[AVAudioSession sharedInstance] setCategory: AVAudioSessionCategorySoloAmbient error: &setCategoryError];

Am I doing something wrong here?

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

I am assuming your AVAudioPlayer instance is on the main thread. Move the AVAudioPlayer instance to its own thread. Graphics rendering performance will improve as a result.

Your applications audio session singleton should have no, or at most very minimal, effect with respect to your animation issue. (as you pointed out by ensuring it is set to a non-mixable category)

share|improve this answer
add comment

Your Answer


