Message Boards Message Boards

Back

Dynamically Retrieving Audio Files

Toggle
Dynamically Retrieving Audio Files
Answer
10/21/25 3:07 PM
Is there a way to call an audio file into an SB similar to how you call a CSV into SB? I'm making some flashcards and I want to have it recognize from the CSV if there is an audio file available for the term and pull in the audio if it's needed.
0 (0 Votes)

RE: Dynamically Retrieving Audio Files
Answer
10/21/25 5:45 PM as a reply to BYUContinuing Education.
I think this is possible at the moment with the Web Object (IFrame). Your CSV and actions would do a lot of the heavy lifting. The CSV would have the:
  • term
  • definition
  • whether or not an audio clip is supplied
  • the URL of the audio (or if this field is blank, assume there is no audio)
From there, you can load the term/definition and show/hide a speaker button. And you could pass the audio URL into the Web Object, which has some javascript to play the audio. Here's a simple case (see attached image and file).

I'm passing the contents of the Text Input (which is a URL) into the Web Object. The Web Object has some very simple javascript to take that URL, (show it to me for debugging), load it, and play it.

Now. Where are the audio clips hosted? Dynamically loading those URLs may cause issues depending on the server where the lesson and audio clips are hosted (cross domain loading often requires both servers to be on board). If you can, probably using relative paths and tossing the audio clips into the lesson might be the way to go.

Browser media autoplay blocking may also cause issues. I don't know if the browser considers the audio part of the lesson webpage, or a new webpage, so when you test, try to use a computer / browser that hasn't been to the site before and see if it causes any issues. There's the whole media engagement index thing. Looks like you might be able to test this with a "Guest Window".

I would try building a simple case and hosting it on your server to make sure it all works before building this out further. Hope that helps!
0 (0 Votes)