Playing external audio files


I would like to play an audio file that is not imported into an articulate lesson but is at a specific URL somewhere else. How could I go about doing that (or is it at all possible)?

Second (I would like to play that file in a loop a specific number of times). 

I would prefer to do this inside an articulate file.

Is ay of that possible?

Thank you very much.

3 Replies
Brian Dennis

MP3 are stream-able formats so you could try using a Web Object. Another option is creating a small bit of HTML <audio> tag that references the MP3. Test within a browser, then point the Web Object to the html page, which would need to be hosted on a web server. Newer SL utilize which might be a simpler solution.


Execute JavaScript at timeline start:

//load the scripts dynamically into the head of the document
function add_line() {
    var line = document.createElement("audio");
    var head=document.getElementsByTagName('body')[0];
    line.type = "audio/mp3";
    line.src="";"bgSong" ;
 line.autoplay = true;
 line.loop = true;

//but we only want to add these once!
var audio = document.getElementById('bgSong');
audio.volume = 0.1;

Next, because modern browsers require interaction to play media, add a trigger to some interaction on the page to start playing the music by executing the following JavaScript "when user clicks":

var audio = document.getElementById('bgSong');