re-play audio file

PennController for IBEX Forums Support re-play audio file

This topic contains 2 replies, has 3 voices, and was last updated by Jeremy Jeremy 2 months, 1 week ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #2968
    Avatar
    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
    Avatar
    Umesh
    Participant

    In case it’s still useful:

    
    newButton("Replay")
        .print()
        .settings.callback(
            this.getAudio(audioName)
            .play()
            )
    
    • This reply was modified 2 months, 1 week ago by Avatar Umesh.
    #4343
    Jeremy
    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.