404 error on audio file in preview with button start

I’m trying to start voiceover audio when my animation timeline begins. I know audio needs user interaction, so I added a button to start both the audio and timeline together. The button works, but I get a 404 error for the audio file.

The file is added in Resources, but it won’t load in the browser preview. I’ve never used audio in Hype before, so maybe I’m missing something.

My main goal is to hear the audio during preview to sync animation timing. Any tips?

Middle_School.zip (1.5 MB)

Try this:

 if (!window.voiceoverAudio) {
    window.voiceoverAudio = new Audio("${resourcesFolderName}/stress2.mp3");
  }

You have to reference the audio file using this replacement variable for the resources folder.

3 Likes

Thank you!