Oliver
Oliver

Reputation: 23520

iPhone - Prevent tick sound at the end of a played sound with AVAudioPlayer

At the end of a short sound played with an AVAudioPlayer, I hear a "tick" sound. I'm playing a repeatedly timed very short sound (0.1 sec) and that "tick" at the end of each play is very very disturbing. How may I prevent that "tick" ?

Upvotes: 0

Views: 261

Answers (1)

hotpaw2
hotpaw2

Reputation: 70703

Make sure the beginning and end of your sound file contains at least a few milliseconds of silence.

The AVAudioPlayer may still produce a tick on some devices with some OS versions, even after 100 mS of silence. If so, you may have to use another audio API. Mixing sound effects into a continuously running Audio Queue or the RemoteIO Audio Unit may be the only way to guarantee absolutely no clicks on all iOS device & OS version combinations.

Upvotes: 1

Related Questions