PDA

View Full Version : AVAudioPlayer muffling sounds.




counciler
Feb 6, 2012, 07:32 PM
Well, I'm trying to make a timer with a custom tick. I was having problems with the timing, but managed to solve that. Now I have a problem with the audio ticking fine for a while, then it'll muffle out one of the ticks. It'll do this several times throughout the duration of the timer. Is there a cause for this that could be explained without the need for code?



samdev
Feb 7, 2012, 12:41 AM
Well, I'm trying to make a timer with a custom tick. I was having problems with the timing, but managed to solve that. Now I have a problem with the audio ticking fine for a while, then it'll muffle out one of the ticks. It'll do this several times throughout the duration of the timer. Is there a cause for this that could be explained without the need for code?

What do you mean by "audio ticking" ?

Are you playing short, non-repeating sounds or long, continuous sounds, like music?

counciler
Feb 7, 2012, 07:08 PM
I'm playing 2 short ticks per second. The ticks are about .25 seconds long. They repeat in the sense that I make them repeat by playing them again when they're finished playing. But I don't set it to repeat.

samdev
Feb 7, 2012, 07:52 PM
I'm playing 2 short ticks per second. The ticks are about .25 seconds long. They repeat in the sense that I make them repeat by playing them again when they're finished playing. But I don't set it to repeat.

How are you drawing your view? Are you using CALayer shadows?

Layer shadows is a real performance killer. It will kill animations, and I also believe it
will kill sound too, at random, unexpected times.

If not shadows, then I would begin by stripping away all graphical elements, to see if
that helps your audio problem.

counciler
Feb 9, 2012, 04:17 PM
I only have a few UI elements. It's not a very complex program, it's just a timer. If the phone can't handle a few graphics and a few sounds then there's some serious issues. But I'm tired of AVAudioPlayer. It's a crap class who's only purpose serves as perhaps playing a simple loop or maybe a song. I'm going with OpenAL.