You are not logged in.

1

Friday, February 21st 2014, 9:02am

[resolved]How to add a global sound for a virtual tour and pano sounds for each scene at the same virtual tour?

Hi All.

I have a question for krpano sound plugin, i don't know how to write the code to make the function. I made a virtual tour with three panos, it needs a global music for the virtual tour, and the global music is able to autoplay when the virutal tour starts. And there are three different background sounds for each pano. when the first scene is playing, the global music is playing automatically with the pano's background sound playing at the meantime. who could give me some tips to make this? it will be better if there is a example xml code for this function. thanks very much.

This post has been edited 1 times, last edit by "Jasonliu" (Mar 16th 2014, 10:57am)


2

Monday, February 24th 2014, 9:36am

Hi,

here some basic sample code:

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<krpano onstart="playsound(bg, backgroundmusic.mp3); loadscene(scene1,null,MERGE);">

  <plugin name="soundinterface" url="soundinterface.swf" alturl="soundinterface.js" preload="true" />

  <scene name="scene1">
    <events name="scene1events" onxmlcomplete="playsound(scene1sound, scene1music.mp3);" onremovepano="stopsound(scene1sound);" />
    ...
  </scene>

  <scene name="scene2">
    <events name="scene2events" onxmlcomplete="playsound(scene2sound, scene2music.mp3);" onremovepano="stopsound(scene2sound);" />
    ...
  </scene>

</krpano>


But keep in mind that on iOS devices only one sound at one time can be played.
See also here:
http://krpano.com/plugins/soundinterface/#html5

Best regards,
Klaus