Reply To: MediaRecorder – filenames using ID

PennController for IBEX Forums Support MediaRecorder – filenames using ID Reply To: MediaRecorder – filenames using ID

#8268
Jeremy
Keymaster

Hi Dod,

PennController Var elements are not javascript variables (visit the link in my message above to read about differences between PennController and plain javascript)

The keyword variable has no meaning in plain javascript, and PennController defines no global object with that name. You will sometimes see variable in the scope of Template in some people’s code, but in your case it looks like you are using row instead (as determined by row =>, which I assume comes with Template in your code)

You could try that instead:

const speakID = [...Array(4)].reduce(a=>a+alphanum.charAt(Math.floor(Math.random()*alphanum.length)),'')

newTrial("speakID",
    newText("speakID", speakID).print()
    ,
    newButton().print().wait()   // to be deleted, just to double check that the code matches the audiofile
)
.log("speakID", speakID)

// ...
newMediaRecorder(row.itemID+"_"+row.modality+"_"+speakID, "audio")

Jeremy