hi guys, i have a simple UIButton that, once clicked, plays a 1 second sound. i want to be able to click that button really fast and produce that sound as many times as i humanly can. i currently have this up and running by including the <AVFoundation/AVAudioPlayer.h> and maybe that is where the culprit is... also, i am digging into apple's references and cannot find the info for how quick is a UIButton to respond to each event and how, if at all, i can control and manipulate this value. hi guys, i have a simple UIButton that, once clicked, plays a 1 second sound. i want to be able to click that button really fast and produce that sound as many times as i humanly can. i currently have this up and running by including the <AVFoundation/AVAudioPlayer.h> and maybe that is where the culprit is... also, i am digging into apple's references and cannot find the info for how quick is a UIButton to respond to each event and how, if at all, i can control and manipulate this value. should i switch to a different audio framework like the "audio toolbox" or is there a way for me to speed things up, or perhaps instruct a button to accept a 2nd and 3rd press while the action of the first press is still underway. cheers! ~nir. cheers! ~nir.
Shouldn't be a speed problem as long as the button registers on "Touch Down" rather than "Touch up inside" or similar. The audio could delay things if it is not preloaded when you hit the button.
thanx nick for your reply. i am using "Touch Down" and i am pre-loading the audio file. is there a way for me to speed things up by instructing the button to accept a 2nd and 3rd press while the action of the first press is still underway? cheers! ~nir.
Haven't really tried anything like the scenario you describe, but a good start for you would be to find out whether the audioplayer is the culprit (as you suggest). Why not replace the call with a less expensive one for testing purposes? Like increasing an int and outputting it to a label for instance. This way you'll find out if it's the UIButton or the Audioplayer that's delaying things...