How to add audio into a slider? | Experience Community
Skip to main content
Solved

How to add audio into a slider?

  • Jan 29, 2019 6:50 PM UTC
  • 9 replies
  • 108 views

Dear Qualtrics community, Does anyone know how to add audio into a slider in Qualtrics? I would like to add several sounds to different levels in a slider, such that participants can adjust the slider and hear different sounds (and locate their answer based on the sounds).

Best answer by Anonymous

Hello @Irene , Please find the attached QSF and for survey link click here
View original

9 replies

  • Author
  • Jan 29, 2019 6:50 PM UTC
Hi! Does anyone know how to add audio into a slider in Qualtrics? I would like to add several sounds to different levels in a slider, such that participants can adjust the slider and hear different sounds (and locate their answer based on the sounds).

w.patrick.gale
Level 3 ●●●
Forum|alt.badge.img+13
@Irene Take a look at this post. I'm assuming you know how to load your audio files and get them to play using Javascript at the very least.

fleb
Level 3 ●●●
Forum|alt.badge.img+6
  • Level 3 ●●●
  • Jan 30, 2019 10:14 AM UTC
Hi @Irene , what about something like this? Qualtrics.SurveyEngine.addOnload(function() { // the id of the question for referencing the value var q_id = this.questionId; var x = document.getElementById("myAudio"); //Get the HTML audio element which is defind in the question body var val; window.setInterval(function(){ //Execute function again and again after a very short certain time period val = $(q_id+'~1~toolTipBox').innerHTML; //Value of the slider if( val > 20 && val < 30) {x.play();} //Star playing when value is between 20 and 30 }, 50); });

  • Author
  • Jan 30, 2019 3:40 PM UTC
Thank you @fleb ! I tried to replace "myAudio" with the HTML of the audio I want it to play, but it says invalid javascript. What more do I need to replace/include? I am very new at Qualtrics.. Thank you so much for helping out!

  • Answer
  • Jan 30, 2019 4:16 PM UTC
Hello @Irene , Please find the attached QSF and for survey link click here

  • Jan 30, 2019 5:04 PM UTC
Hello @Irene , Please follow this post

fleb
Level 3 ●●●
Forum|alt.badge.img+6
  • Level 3 ●●●
  • Jan 30, 2019 7:00 PM UTC
Hi @Irene, the HTML code must be in the body of the question, not in the script. Use "HMTL View to insert it". ID of the audio element must be "myAudio" unless you modify the script.

  • Author
  • Jan 31, 2019 10:06 AM UTC
Thanks @Shashi ! Where do I insert the HTML of the audio?

  • Jan 31, 2019 2:15 PM UTC
> @Irene said: > Thanks @Shashi ! Where do I insert the HTML of the audio? Go to question Rich content editor -> "<>" source view