Response time for a UIButton for an iPad application

Discussion in 'Public Game Developers Forum' started by pengas, Jun 21, 2010.

  1. pengas

    pengas New Member

    Jun 21, 2010
    2
    0
    0
    #1 pengas, Jun 21, 2010
    Last edited: Jun 21, 2010
    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.
     
  2. NickFalk

    NickFalk Well-Known Member

    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.
     
  3. pengas

    pengas New Member

    Jun 21, 2010
    2
    0
    0
    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.
     
  4. NickFalk

    NickFalk Well-Known Member

    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...
     

Share This Page