const utterances = ['utt01', 'utt02', 'utt03']
const analysis = ['try+ing', 'climb+ing', 'swimm+ing']
const translation = ['trying', 'climbing', 'swimming']
let utteranceIndex = 0;
loadUtterance(utterances[utteranceIndex]);
function loadUtterance(utterance) {
audio.src = `audio/${utterance}.mp3`;
subtitle.innerText = utterance;
translation.innerText = translation;
}
This is meant to be an exercise for studying a foreign text. I want to
- load and play the first utterance in the array;
- display the transcription (subtitle) of the utterance;
- Display the English translation. Then play the next utterance.
I have added the "analysis" array to help visualize what I am trying to do. Eventually I'd like to display the translation (and the analysis) only after an eventListener (the student's request with a click).
Problem: the translation items do not load with this script. I am a long retired linguist looking for some guidance. Thank you.
translationis an array, it has noinnerTextproperty