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.

jschrader

Intermediate

  • "jschrader" started this thread

Posts: 237

Location: Bavaria, Germany

Occupation: Photographer, Producer

  • Send private message

1

Tuesday, December 15th 2015, 2:08pm

Help with sound selecstion needed

I'm using a toggle button to start/pause/resume a single narrative in my panoramas.

Source code

1
2
3
4
5
6
7
8
9
10
11
	<plugin name="soundinterface" url="sound/soundinterface.swf" volume="1.0" keep="true" alturl="sound/soundinterface.js" onloaded="preloadsound(sound/sound.mp3); "/>
	<plugin name="snd_start" zorder="5" url="buttons/soundonoff.png" align="leftbottom" x="16" y="16" alpha="1.0" scale="1.0" crop="0|50|50|50" onclick="playsound(sound,sound/sound.mp3,1); action(changebutton);"/>
	<plugin name="snd_pause" zorder="4" url="buttons/soundonoff.png" align="leftbottom" x="16" y="16" alpha="0.0" scale="1.0"  crop="0|0|50|50" onclick="pausesoundtoggle(sound); switch(crop, 0|0|50|50, 0|50|50|50);"/>

	<action name="changebutton">
		tween(plugin[snd_start].alpha, 0.0,,,);
		set(plugin[snd_start].enabled,false);
		set(plugin[snd_start].visible,false);
		tween(plugin[snd_pause].alpha, 1.0);
		set(plugin[snd_pause].enabled,true);
	</action>


In a tour with several panoramas it is a bit clumsy to copy/paste/edit the same routine into each scene, and I guess it would be easier and more elegant to have just one button plugin that plays the sound that belongs to each scene.

With my very basic knowledge of krpano coding I've tried to get that to work using code snippets from search results, but whatever I try it will not work. So I assume I'm missing some essential routines but have no idea where to look at.
I understand that it has to be using things like for example "set currentsound,sound01" ... But I'm lost about how and when to recall such variables. The documentation won't help me here as it shows samples and syntax for single commands but not for complex tasks like these. Unfortunately I also couldn't find a solution to similar problems that I could try to adapt in the forum. Please shed some light on this and put me into the right direction.

Hint for Klaus: I'm sure it will be much appreciated if you add a speaker button to the controlbar of your MAKEVTOUR template that does exactly this: start a sound or narrative for the specific scene. *thumbsup*

Similar threads