Page 1 of 1

Playing Audio in Conversation with ARISjs

Posted: Mon Jun 18, 2018 8:23 am
by jdolane5
Hi there. I'm new to ARISjs. I'm looking for a way that I can play an audio file within a conversation. I uploaded an mp3 into media and called it "3_audio1". I've tried the following code but it hasn't worked. I think I might be missing a step in assigning the media with an ID.

<script type='text/javascript'>

var ARIS = {};
ARIS.ready = function()
ARIS.prepareMedia(3_audio1);           //Loads audio media with specified id into memory
ARIS.playMedia(3_audio1);              //Plays audio media with specified id
ARIS.stopMedia(3_audio1);              //Stops playing audio media with specified id
ARIS.setMediaVolume(3_audio1, volume); //Sets volume for audio media with specified id

Re: Playing Audio in Conversation with ARISjs

Posted: Mon Jun 25, 2018 11:38 am
by cleffingwell
Media IDs can be found by clicking on the media item in the media folder in the editor, then hovering on that media window in the upper right area of the media window.
Then enter that numerical ID (without any quotes) in the ARISjs parenthesis.

There is also a way to get the ID by using the name as a reference and storing it in a variable then using the variable name in the ARISjs commands. I don't know how javascripty you are. If you go to the ARISjs manual or the GITHUB links, there are examples of the technique buried in some of the basic examples folder.

Re: Playing Audio in Conversation with ARISjs

Posted: Mon Jul 09, 2018 2:44 pm
by jdolane5
Thank you for your reply! It should help to know where the media ID can be found. What we're trying to do now is to put a media player into a plaque. We can easily do that with media that's stored on the web, using the following code:


However, we would like some way of using our own media that has been uploaded into ARIS rather than online media. I don't know if I'll have to call the media up with javascript before it can be played in the player. It doesn't work simply by plugging in the media ID, and I also don't know what to put for a source in this case.

Re: Playing Audio in Conversation with ARISjs

Posted: Tue Jul 10, 2018 10:34 am
by cleffingwell
Actually you can access the media in the ARIS media folder that you uploaded and treat it as a link for your source for the audio tag.
In the editor, go to the media tab, click on the media you are interested in showing and you should get to a screen where you can play your media. Right click on the grey area of where you can play the media and 'copy audio address'
Paste that into your audio tag as the source ( SRC=" " ) and it should play.