Playing Audio in Conversation with ARISjs
  • jdolane5
    Posts: 3
    Joined: Mon Jun 18, 2018 8:21 am

    Playing Audio in Conversation with ARISjs

    by jdolane5 » Mon Jun 18, 2018 8:23 am

    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()
    {
    //Advanced
    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
    }
    </script>
  • cleffingwell
    Posts: 50
    Joined: Tue Feb 14, 2017 7:45 am
    Location: Eau Claire
    Contact:

    Re: Playing Audio in Conversation with ARISjs

    by cleffingwell » Mon Jun 25, 2018 11:38 am

    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.

    http://manual.arisgames.org/editor/arisjs

    https://github.com/ARISGames/ARISjsExamples
    Attachments
    Capture.PNG
    Capture.PNG (10.19 KiB) Viewed 65 times
  • jdolane5
    Posts: 3
    Joined: Mon Jun 18, 2018 8:21 am

    Re: Playing Audio in Conversation with ARISjs

    by jdolane5 » Mon Jul 09, 2018 2:44 pm

    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:

    <audio
    id=""
    controls
    src="">
    </audio>

    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.
  • cleffingwell
    Posts: 50
    Joined: Tue Feb 14, 2017 7:45 am
    Location: Eau Claire
    Contact:

    Re: Playing Audio in Conversation with ARISjs

    by cleffingwell » Tue Jul 10, 2018 10:34 am

    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.
    Attachments
    Capture3.PNG