I am trying to translate the the following code in python to javascript:
if sound_1.status == FINISHED:
break
if done_audio.keys == 'space':
audio_loop.finished = True
This code component is in a routine that allows the user to test their audio by pressing a specific button for as many times as they please, and when they are satisfied with their audio, they press space to continue to the next routine. This code works fine in the builder, but I suspect there is an issue with my javascript translation (trying to put this experiment online).
This is the JS code I have right now:
if sound_1.status == FINISHED {
break;
}
if done_audio.keys == 'space' {
audio_loop.finished = true;
}
Is there any obvious issue? I’m unsure about the .keys function.