Keypress to initiate mediarecord

PennController for IBEX Forums Support Keypress to initiate mediarecord

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #7321
    ktetzloff
    Participant

    Is there a way to initiate the recorder via key press rather than with a button click or a timer? Right now, if I use .print() with newVoiceRecorder it makes a button, but i would really like to be able to initiate the recorder with a key press instead. Is there any way to do this? Here is an example item below. Thank you so much!!!

    [“item”, “PennController”, PennController(
    newText(“instructions”, “Listen to the sentence and then repeat it while recording your voice”)
    .print()
    ,
    newAudio(“sound”, “webaddressofsounnd.html”)
    .print()
    .wait()
    ,
    getAudio(“sound”)
    .remove()
    ,
    newVoiceRecorder(“recorder”) \\this is where i would like the keypress rather than button
    .print()
    ,
    newButton(“validate”, “Click to continue”)
    .print()
    .wait()
    )]

    #7322
    amilam
    Participant

    Hi,

    You can do the following (and in the Key command insert any Key you want, and you can add optional text with instructions ):

    [“item”, “PennController”, PennController(
    newText(“instructions”, “Listen to the sentence and then repeat it while recording your voice”)
    .print()
    ,
    newAudio(“sound”, “webaddressofsounnd.html”)
             .print()
             .wait()
    ,
    getAudio(“sound”)
            .remove()
    ,
    newMediaRecorder("recorder", "audio")
            .record()
            .log()
    ,
    newKey(" ")
            .wait()
    ,
    getMediaRecorder("recorder")
            .stop()
    ,
    newButton(“validate”, “Click to continue”)
            .print()
            .wait()
    )]

    Hope it helps!

    • This reply was modified 2 years, 7 months ago by amilam.
    #7324
    ktetzloff
    Participant

    Thank you so much!!!

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.