Reply To: Playing audio word-by-word

PennController for IBEX Forums Support Playing audio word-by-word Reply To: Playing audio word-by-word

#5975
Jeremy
Keymaster

Hi,

The callback command is a non-blocking command, meaning that everything after the closing parenthesis of callback will be executed immediately, with no further delay. You probably want to use the blocking command wait instead:

newTrial("test_audio",    
  newAudio("test", "2fishRoundTank.mp3")
    .play()
    .log()
    // .print() // Do you really want to show the player?
  ,
  newTimer("reg1", 800).start().wait(),
  getAudio("test").pause(),
  newKey("next", " ").log().wait()
  ,
  getAudio("test").play(),
  newTimer("reg2", 400).start().wait(), // I assume you want to play the next 400ms
  getAudio("test").pause(),
  getKey("next").wait()
  ,
  getAudio("test").play(),
  newTimer("reg3", 400).start().wait(),
  getAudio("test").pause(),
  getKey("next").wait()
  ,
  newButton("Next")
    .print()
    .wait()
)

Jeremy