Automatically Playing Sound | XM Community
Solved

Automatically Playing Sound

  • 11 January 2019
  • 9 replies
  • 1104 views

Hi all! I am looking for a way to play the audio file as soon as the slide is loaded (without requiring individuals to click on play). But, I do not want the slide to advance automatically. I just need the audio to play automatically.

I found answers to similar questions from June, November, and September and none of them are working for me. Is it possible the javascript for playing audio automatically on load is not working anymore? I'm using the Google Chrome web browser.

Any help is appreciated! Thank you in advance!!
icon

Best answer by Anonymous 11 January 2019, 20:28

View original

9 replies

Hi all! I am looking for a way to play the audio file as soon as the slide is loaded (without requiring individuals to click on play).

I found answers to similar questions from June, November, and September and none of them are working for me. Is it possible the javascript for playing audio automatically on load is not working anymore?
Hello @AOG ,

Please use the below code if your URL has audio extension at the end

`<audio autoplay controls><source src="Audio_URL" type="audio/*" /> Your browser does not support the audio element.</audio>`

Please use the below code if your audio is uploaded in qualtrics library

`<embed autostart="true" height="90" hidden="true" loop="false" src="YOUR_AUDIO_SOURCE_URL" width="180"></embed>`
Hello @AOG ,

Follow this post
Thank you for your quick response!

Should I input that code into "Qualtrics.SurveyEngine.addOnload(function()" where it says "Place your JavaScript here to run when the page loads":

If so, I got this error message:
Alert
Invalid JavaScript! You cannot save until you fix all errors: Unexpected token ILLEGAL
> Should I input that code into "Qualtrics.SurveyEngine.addOnload(function()" where it says "Place your JavaScript here to run when the page loads":
>
> If so, I got this error message:
> Alert
> Invalid JavaScript! You cannot save until you fix all errors: Unexpected token ILLEGAL

Paste the code in the question Rich content editor -> Source view
When I did that it added another audio bar with 0:00 / 0:00 on it, but the original audio does not play automatically on page load.

This is a file I am uploading from the media library as an m4a file, and not a URL from the internet. Does that matter?
When using the code for automatic play, it loads on preview of slide and preview of block, although it does echo, which I read the echo goes away when published. However, when I publish to review the survey there is no sound and the survey does not start from the beginning, but starts on slides that do not have audio. Help!
Hi ive tried this and it says the code is wrong or invalid, any suggestions?
> @Shashi said:
> Hello @AOG ,
>
> Please use the below code if your URL has audio extension at the end
>
> `<audio autoplay controls><source src="Audio_URL" type="audio/*" /> Your browser does not support the audio element.</audio>`
>
> Please use the below code if your audio is uploaded in qualtrics library
>
> `<embed autostart="true" height="90" hidden="true" loop="false" src="YOUR_AUDIO_SOURCE_URL" width="180"></embed>`
Hi, sound works for me using the the code <embed autostart="true"....!
BUT the sound starts immidiately when I start the survey although the sound is suppose to come many survey pages later? It seems as the sound is linked to the survey (automatically) and not to the specific page? I want a new sound on each page (page break) but the first sound seems playing once I start the survey. I would be very greatful if someone have any clever ideas! Thanks

Leave a Reply