Select to view content in your preferred language

Automatic audio playback in Survey123

296
1
03-19-2024 09:33 PM
Samuel_McAuley
New Contributor II

I would like to be able to automatically play an alert at a defined time within my survey. The problem is this - we have people going out into the field to perform bird surveys that are 20 minutes long. I have currently created a custom Javascript function that displays the time remaining in the survey and counts down, however I would also like an audio alarm to play once the time reaches 0. The people doing the survey cannot be watching the timer as they need to be looking for birds during the survey and so need the audio feedback. Is this possible?

 

I added something simple into the start of my JS function like this;

var alarmSound = new Audio('path/to/your/alarm-sound.mp3');

alarmSound.play();

And created a local MP3 for the purposes of testing but the 'Audio' function was not recognised in the Javascript function console in Survey123 connect. Any and all help would be greatly appreciated

0 Kudos
1 Reply
Samuel_McAuley
New Contributor II

UPDATE: I have just reviewed this blog post - Custom JavaScript functions in Survey123 (esri.com) - and my guess based on this is that it is not possible. Specifically, the line about "You can't access local files" makes me think that what I am proposing can't be done, as the mp3 alarm sound will inevitably have to be stored locally in order to be played. That said, I would love to hear what others' experience has been like trying to solve a similar problem and what they have found.

0 Kudos