Play a beep that loop and change the frequency/speed
I am creating an iphone application that use audio. I want to play a beep sound that loop indefinitely.
I found an easy way to do that using the upper layer AVAudioPlayer
and the numberOfLoops
set to "-1
". It works fine.
But now I want to play this audio and be able to change the rate / speed. It may works like the sound played by a car when approaching an obstacle. At the beginning the beep has a low frequency and this frequency accelerate till reaching a开发者_高级运维 continuous sound biiiiiiiiiiiip ...
It seems this is not feasible using the high layer AVAudioPlayer
, but even looking at AudioToolBox
I found no solution.
Any help?
Take a look at Dave Dribin's A440 sample application, which plays a constant 440 Hz tone on the iPhone / iPad. It uses the lower-level Audio Queue Services, but it does what you're asking (short of the realtime tone adjustment, which would just require a tweak of the existing code).
精彩评论