I am having a similar problem. Using an AVPlayer
or AVAudioPlayer
for a length of time, in my case to play multiple clips with pauses in between, causes the audio to degrade. First it begins to get scratchy, then as it gets worse it eventually drops off completely and is inaudible.
I have attempted creating new AVAudioPlayer's
for each clip to no avail.
I am suspect that the audio files themselves (*.m4a) are causing the problem. Some contain static themselves even after a few rounds of noise reduction. Though the static within them is not the static the AVAudioPlayer is introducing.
I am working on two alternate theories and a theory;
- Use the original *.wav files or *.mp3 files
- Deactivate/Activate the
AVAudioSession
between clips or periodically.
- This may be just a simulator problem and not happen on the device (theory).
Though these may not be applicable to your stream, perhaps there is a solution in here somewhere.
UPDATE: *.wav vs *.m4a makes no difference.
UPDATE: This is not happening on the device itself, only in the simulator for me.