You are not logged in.

Dear visitor, welcome to krpano.com Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

vasin

Trainee

  • "vasin" started this thread

Posts: 93

Location: bangkok

Occupation: photographer

  • Send private message

1

Monday, July 1st 2013, 12:19pm

background sound

Hello Everyone,


I never tried adding sound to the virtual tours, so it is my first time. And I need your help.
My virtual tours are generated automatically by the make vtour tool.


I tried adding this code

Source code

1
2
3
4
<!-- load the soundinterface plugin --> 	<plugin name="soundinterface"	    	url="http://at-bangkok.com/virtualtours/snc/plugins/soundinterface.swf"	    	alturl="http://at-bangkok.com/virtualtours/snc/plugins/soundinterface.js"	    	rootpath=""	    	preload="true"	    	keep="true"	    	/>
	<!-- start playing the sound -->	<events name="currentpano"	        onnewpano="playsound(bgsnd, 'http://at-bangkok.com/virtualtours/snc/1.MP3|http://at-bangkok.com/virtualtours/snc/1.wav', 0);"	        onremovepano="stopsound(bgsnd);"	        />

	<!-- button to pause the sound: -->	<plugin name="snd" url="http://at-bangkok.com/virtualtours/snc/soundonoff.png" align="topleft" x="10" y="10" alpha="0.25" scale="0.5" onover="tween(alpha,1);" onout="tween(alpha,0.25);"	        crop="0|0|50|50"	        onloaded="if(ismobile,set(scale,1));"	        onclick="pausesoundtoggle(bgsnd); switch(crop, 0|0|50|50, 0|50|50|50);"	        />




to the both tour.xml and vtourskin.xml but it don't work. The soundonoff.png doesn't even show.

Please let me know what I did wrong. the vtour link is http://at-bangkok.com/virtualtours/snc/

Any input would be appreciated. Thank you!

Best regards
VAsin

vasin

Trainee

  • "vasin" started this thread

Posts: 93

Location: bangkok

Occupation: photographer

  • Send private message

2

Tuesday, July 2nd 2013, 8:32am

The audio dose work on Android 4.2 and IPAD, but the sound on off button doesn't display.

BUT it does not work on the PC.

I can't figure out why the "sound on off" does not appear?

Source code

1
2
3
4
<plugin name="soundinterface"	        url="plugins/soundinterface.swf"	        alturl="plugins/soundinterface.js"	        rootpath=""	        preload="true"	        keep="true"	        />
	<!-- start playing the sound -->	<events name="currentpano"	        onnewpano="playsound(bgsnd, '1.mp3|1.wav', 0);"	        onremovepano="stopsound(bgsnd);"	        />

	<!-- button to pause the sound: -->	<plugin name="snd" url="soundonoff.png" align="lefttop" x="10" y="10" alpha="0.25" scale="0.5" onover="tween(alpha,1);" onout="tween(alpha,0.25);"	        crop="0|0|50|50"	        onloaded="if(ismobile,set(scale,1));"	        onclick="pausesoundtoggle(bgsnd); switch(crop, 0|0|50|50, 0|50|50|50);"	        />	



Please any input? the tour.xml file is attached
vasin has attached the following file:
  • tour.xml (10.26 kB - 214 times downloaded - latest: May 25th 2023, 7:18am)

3

Tuesday, July 2nd 2013, 12:00pm

Hi,

the "currentpano" <events> and "snd" <plugin> elements need a keep="true" to be able to used within the scenes.

Without keep="true" they will be get instantly removed at startup when the first scene will be loaded.

Best regards,
Klaus

vasin

Trainee

  • "vasin" started this thread

Posts: 93

Location: bangkok

Occupation: photographer

  • Send private message

4

Tuesday, July 2nd 2013, 1:06pm

Klaus,

Thank you so much.

It worked but every time I change a scene, the audio starts over.

Is it possible to have it play continuously and loop when it ends?

Source code

1
2
3
<plugin name="soundinterface"	        url="plugins/soundinterface.swf"	        alturl="plugins/soundinterface.js"	        rootpath=""	        preload="true"	        keep="true"	        />
	<events name="currentpano"	        onnewpano="playsound(bgsnd, '1.mp3|1.wav', 0);"	        onremovepano="stopsound(bgsnd);"			keep="true"	        />
	<plugin name="snd" url="soundonoff.png" align="lefttop" x="10" y="10" alpha="0.25" scale="0.5" onover="tween(alpha,1);" onout="tween(alpha,0.25);"	        crop="0|0|50|50"	        onloaded="if(ismobile,set(scale,1));"	        onclick="pausesoundtoggle(bgsnd); switch(crop, 0|0|50|50, 0|50|50|50);"			keep="true"	        />



Thank you again

5

Tuesday, July 2nd 2013, 1:24pm

Hi,

the event will be called with every new pano,
to play it only once with remove the event after the first call or use the krpano onstart event to play the sound,

e.g.
<events name="currentpano" keep="true" onnewpano="playsound(bgsnd, '1.mp3|1.wav', 0); set(events[currentpano].onnewpano,null);" />

or simply:
<krpano onstart="...; playsound(...);">
...

Best regards,
Klaus

vasin

Trainee

  • "vasin" started this thread

Posts: 93

Location: bangkok

Occupation: photographer

  • Send private message

6

Tuesday, July 2nd 2013, 1:43pm

got it

Thank you so much!

7

Tuesday, December 22nd 2020, 6:14pm

Not working on my project

Hello can you share your tour.xml because i implement same thing on my project but it's not working please help.