0 votes
ago in SoSci Survey (English) by s334812 (110 points)

Hello,
my survey asks participants to listen to 60 audio stimuli (each 10 seconds long; presented in a randomized order) and to rate them. A small percent of participants (~7 out 200; the actual number could be much higher but these were the ones kind enough to report) reported that they didn't hear many of the stimuli, often in an alternating fashion (i.e., every second stimuli did not play). Several of the participants reported using Chrome, so the browser does not seem to be the problem.

I am guessing this is related to poor internet connection, and that the stimuli were not loading properly, but it is difficult to know for sure.

A few examples on this page: https://www.soscisurvey.de/help/doku.php/en:create:media, show html code with both autoplay and preload = 'auto'.
However, here https://www.w3schools.com/tags/att_audio_preload.asp it says that 'The preload attribute is ignored if autoplay is present.' therefore I didn't include the preload attribute. But maybe this is why some participants had issues? Do you have other suggestions why I might be having such an issue? In debug mode, I also get this warning: 'You are storing data (%blocks%) with more than 2 KB in the interview case. Please consider using the show() command instead of replace() for large placeholders.' Maybe this is related?

In other survey platforms, there is the possibility to preload all the stimuli before the survey starts (or while the participant fills in the consent form, reads instructions etc.) but I couldn't find a why to do this with soscisurvey. Is that possible?

I apologize, this is many questions at once... Thanks in advance!

Here's the code I'm using to shuffle and autoplay the stimuli which are all uploaded to the host server and are 407 KB each:

if (!isset($blocks)) {
// Define question/audio pairs
$blocks = [
    ['WM01', 'DS_102_0.051.mp3', 'DS_102_0.051.ogg'],
    ['WM02', 'DS_104_0.057.mp3', 'DS_104_0.057.ogg'],
    ['WM03', 'DS_112_0.064.mp3', 'DS_112_0.064.ogg'],
    ['WM04', 'DS_114_0.062.mp3', 'DS_114_0.062.ogg'],
    ['WM05', 'DS_120_0.067.mp3', 'DS_120_0.067.ogg'],
   // truncated for display 
];

// Shuffle order
shuffle($blocks);

// Register for later pages
registerVariable($blocks);
}

// Which item on this page
$i = loopPage(count($blocks));

// Store which audio was played

$id = id('IV01', $i + 1);
// Save the value from the array here
put($id, $blocks[$i][1]);

// Output raw HTML (audio player)
html('<audio controls autoplay style="position: absolute; left: -9999px; top: -9999px">
    <source src="' . $blocks[$i][1] . '" type="audio/mpeg">
    <source src="' . $blocks[$i][2] . '" type="audio/ogg">
    Your browser does not support the audio element.
</audio>');
// Show the question
question($blocks[$i][0]);
ago by s000002 (349k points)
Did you test if both, the mp3 and the ogg will play, when opening them in the browser directly?

Were you able to reproduce the error? Does the browser console (https://www.soscisurvey.de/help/doku.php/en:general:browser-tools) show anny errors?

Any chance that the file names are not 100% correct, including the case, as .mp3 is not the same as .MP3
ago by s334812 (110 points)
Thanks for your response!

I have been unable to reproduce the error, and the browser console did not show any errors (which I guess makes sense if I didn't experience any).

I have tried with only the .mp3 files and only the .ogg files and both worked without issue.

1 Answer

0 votes
ago by s000002 (349k points)

I have been unable to reproduce the error, and the browser console did not show any errors

Well, the most likely explanation then is that the browsers blocked the autoplay for privacy reasons.

You may want to replace yout HTML code (the 5 lines at the end) ba something a bit more complex. The HTML from the manual for video files (!) includes some JavaScript to leave the player visible until the autoplay works. If the autoplay fails, respondents can still click the play button themselves.

I cannot guarantee that it will solve the issues that you desribed, but it's worth a try.

ago by s334812 (110 points)
Thanks again, I will try this!

Willkommen im Online-Support von SoSci Survey.

Hier bekommen Sie schnelle und fundierte Antworten von anderen Projektleitern und direkt von SoSci Survey.

→ Eine Frage stellen


Welcome to the SoSci Survey online support.

Simply ask a question to quickly get answers from other professionals, and directly from SoSci Survey.

→ Ask a Question

...