re-play audio file

PennController for IBEX Forums Support re-play audio file

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #2968
    robpetrosino
    Participant

    Hi, I was wondering how to allow subjects to re-listen to a sound before making a decision. This may be easy, but I can’t figure that out on my own since I am new to IBEX/PennController.

    Thanks!
    -Roberto

    #4339
    Umesh
    Participant

    In case it’s still useful:

    
    newButton("Replay")
        .print()
        .settings.callback(
            this.getAudio(audioName)
            .play()
            )
    
    • This reply was modified 4 years, 5 months ago by Umesh.
    #4343
    Jeremy
    Keymaster

    Thanks Umesh!

    I guess you found this topic using the search form, since it was lacking a parent forums (it was imported from the old website)—I have just fixed that

    To expand on your answer, it’s better not to prefix getAudio with this (as this can have different meanings in different environments) and to make sure to replace audioName with the string you used to name your audio file. Here’s an illustration including an Audio element:

    newAudio("myAudio", "test.mp3")
      .play()
      .wait()
    ,
    newButton("Replay")
      .settings.callback( getAudio("myAudio").play() )
      .print()
Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.