You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/* 2 Harmonic question */
// it's evaluated each time this script or function is run.
var randomQuestion = question_simple[Math.floor(Math.random() * question_simple.length)];
var harmonyQuestion = {
type: jsPsychSurveyMultiChoice,
stimulus: `harmony`,
questions: [
{
prompt: "The correct functional progression of the previous audio is:",
options: harmonicOptions,
required: true,
name: 'harmonyProgression'
}
],
preamble: `<div style="margin-bottom: 20px;">Listen to the recording below and then select the correct functional progression. <br>You must listen to the entire recording before you continue:</div>
<div class="audio-container">
<audio id="harmonyAudio" controls>
<source src="${randomQuestion}" type="audio/mpeg">
Your browser does not support the audio element.
</audio> </div>`,
on_load: function() {
document.querySelector('#jspsych-survey-multi-choice-next').disabled = true;
document.getElementById('harmonyAudio').addEventListener('ended', function() {
document.querySelector('#jspsych-survey-multi-choice-next').disabled = false;
});
},
// Include the played audio file in the data to be saved
data: {
questionAudio: randomQuestion
}
};
timeline.push(harmonyQuestion);
The text was updated successfully, but these errors were encountered:
Dazzid
changed the title
Audio sniped not working in Firefox
Audio snippet not working in Firefox
Mar 29, 2024
I'm running this code, but we have seen that participants using Firefox can not play the audio samples.
How can I fix this issue?
The code I'm using is this one:
The text was updated successfully, but these errors were encountered: