How to set a background sound in all scenes of a vrtour

  • Hi

    It's almost five days that I am trying to set a sound on my virtual tour, like a background sound in every scene which once I open the tour it starts to play, I have already tried the soundinterface plugin and checked almost all related threads on the forum. Do I need to change any code in vtourskin? Now don't know what to do! Here is my tour.xml and I 've saved two audio files with mp3 (2Mb) and wav (28Mb) formats in a subfolder named "sounds" in the vrtour, I'll be grateful if you would help me in it.


    Tarannom
    Bests

  • It was really an easy question and I don't know why I wasnt able to handle it *unsure* Maybe someone like me needs help in it, so the code I used is below:


    At first add the action "playsound(bgsnd, '1.mp3|1.ogg', 0);" to onstart event in main element of a Krpano .xml file.


    <krpano version="1.19" title="Virtual Tour" onstart="playsound(bgsnd, '1.mp3|1.ogg', 0);"
    >


    And then put the code below

    <plugin name="soundinterface"
    url.flash="%SWFPATH%/plugins/soundinterface.swf"
    url.html5="%SWFPATH%/plugins/soundinterface.js"
    rootpath=""
    preload="true"
    keep="true"
    />


    after the code:


    <action name="startup" autorun="onstart">
    loadscene(scene_name, null, MERGE);
    </action>


    I hope it helps *smile*


    Bests
    Fatemeh

  • Hi,

    Best woold be to put the playsound code line in the startup action.
    So, keep it all outside the scenes.
    It could be that a screentouch is needed to start audio.
    I’ll post a simple example tomorrow when i don’t forget.

    simpel code example:

    Hope it helps!

    Tuur *thumbsup*

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!