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

How to add audio into a slider?

  • January 29, 2019
  • 9 replies
  • 51 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

9 replies

  • Author
  • 3 replies
  • January 29, 2019
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
  • Level 3 ●●●
  • 140 replies
  • January 29, 2019
@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 ●●●
  • 197 replies
  • January 30, 2019
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
  • 3 replies
  • January 30, 2019
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!

  • 0 replies
  • Answer
  • January 30, 2019
Hello @Irene , Please find the attached QSF and for survey link click here

  • 0 replies
  • January 30, 2019
Hello @Irene , Please follow this post

fleb
Level 3 ●●●
Forum|alt.badge.img+6
  • Level 3 ●●●
  • 197 replies
  • January 30, 2019
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
  • 3 replies
  • January 31, 2019
Thanks @Shashi ! Where do I insert the HTML of the audio?

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