Recording audio

PennController for IBEX Forums Support Recording audio

Tagged: 

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #4970
    Alan
    Participant

    Hi, I was wondering if there is a feature that allows the recording of audio in the middle of the experiment. Thanks in advance!

    #4971
    Jeremy
    Keymaster

    HI Alan,

    You can record audio any time you want, just make sure that the trial that you create using InitiateRecorder comes before any trial in which you use the VoiceRecorder element in your sequence of trials. For example:

    PennController.ResetPrefix(null)
    
    Sequence( "intro" , "init-audio" , "first-half" , "record-audio" , "second-half" )
    
    AddTable( "first-table" , "ButtonText\nClick on me\nAlmost there\nNext you'll be halfway through" )
    
    AddTable( "second-table" , "ButtonText\nClick again\nAlmost done\nThis is the last trial" )
    
    newTrial("intro" ,
      newText("Welcome!").print()
      ,
      newButton("Start").print().wait()
    )
    
    InitiateRecorder(
      "https://myserver/uploadVoices/saveRecordings.php"
      ,
      "You will first go over a few trials, then record a sample, and then go over some more trial. Please authorize this experiment to access you microphone."
    )
    .label( "init-audio" )
    
    Template( "first-table" , row => 
      newTrial( "first-half" , newButton( row.ButtonText ).print().wait() )
    )
    
    newTrial( "record-audio" , 
      newVoiceRecorder().print().wait()
      ,
      newButton("Continue").print().wait()  
    )
    
    Template( "second-table" , row => 
      newTrial( "second-half" , newButton( row.ButtonText ).print().wait() )
    )

    Of course this example script won’t succeed in sending the audio sample since I provided a fake URL to InitiateRecorder

    Jeremy

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