Sie sind nicht angemeldet.

Lieber Besucher, herzlich willkommen bei: krpano.com Forum. Falls dies Ihr erster Besuch auf dieser Seite ist, lesen Sie sich bitte die Hilfe durch. Dort wird Ihnen die Bedienung dieser Seite näher erläutert. Darüber hinaus sollten Sie sich registrieren, um alle Funktionen dieser Seite nutzen zu können. Benutzen Sie das Registrierungsformular, um sich zu registrieren oder informieren Sie sich ausführlich über den Registrierungsvorgang. Falls Sie sich bereits zu einem früheren Zeitpunkt registriert haben, können Sie sich hier anmelden.

1

Samstag, 23. Mai 2009, 23:34

Load a different MP3 for multiple panoramas

Hi,

I have 3 panoramas and each one has it's own xml file. They are viewable using the combobox and when the first one loads, it's the exterior of a helicopter and I have the sound exterior_running.mp3 playing on a loop. Also the sound on/off buttons are allocated the mp3.

Quellcode

1
2
3
4
5
<plugin name="soundinterface" url="plugins/soundinterface.swf" rootpath="audio" onloaded="preloadsound(exterior_running.mp3);playsound(mymusik,exterior_running.mp3,loops);" />

<plugin name="soundon" url="skin/sound.png" zorder="10" align="bottomright" edge="bottomright" x="185" y="4" onhover="showtext(AUDIO ON,buttonstyle);" onclick="playsound(mymusik,exterior_running.mp3,loops);" />

<plugin name="soundoff" url="skin/soundoff.png" zorder="10" align="bottomright" edge="bottomright" x="150" y="4" onhover="showtext(AUDIO OFF,buttonstyle);" ondown="stopsound(mymusik);" onclick="stopsound(mymusik);" />

Then when either of the others panoramas are chosen (both interior shots) from the combobox I have the following code in their xml files and the sound file interior_running.mp3 should be running.

Quellcode

1
2
3
4
5
<plugin name="soundinterface" url="plugins/soundinterface.swf" rootpath="audio" onloaded="preloadsound(interior_running.mp3);playsound(mymusik,interior_running.mp3,loops);" />

<plugin name="soundon" url="skin/sound.png" zorder="10" align="bottomright" edge="bottomright" x="185" y="4" onhover="showtext(AUDIO ON,buttonstyle);" onclick="playsound(mymusik,interior_running.mp3,loops);" />

<plugin name="soundoff" url="skin/soundoff.png" zorder="10" align="bottomright" edge="bottomright" x="150" y="4" onhover="showtext(AUDIO OFF,buttonstyle);" ondown="stopsound(mymusik);" onclick="stopsound(mymusik);" />


but the problem is even though the new pano has loaded, the sound hasn't changed unless I actually click on the sound on/off buttons to load the new mp3.

What I'd like to do is stop the current sound playing and then start the new one in the next panorama. Is that possible?

Look forward to any advice please.

Thanks,

Andrew

.

Graydon

Profi

Beiträge: 614

Wohnort: Texas

Beruf: Industrial gas turbine services.

  • Nachricht senden

2

Sonntag, 24. Mai 2009, 04:38

First... depends upon how you "flagged" your loadpano action from the combobox...

ref: http://www.krpano.com/docu/actions/#loadpano

If you used "merge"... then new plugins...i.e. new sounds... are not loaded... when they have the same name.

But, since once you are in the new pano and stopping / starting the sound plays the correct one...

... You can update the action that loads the new pano to first stop the sound from the first pano... and then start playing the sound from the new pano after the preview is loaded.

Post the code you use from the combobox to load a new pano and we can probably fill in specifics.

3

Sonntag, 24. Mai 2009, 06:20

Thanks for the reply Graydon.

Here's the code for the combobox. It's the same on each of the three xml files. As you mentioned, the MERGE is there. The only thing really that is different on each of the files is a large amount of hotspots and the sound.

Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
		<plugin name="combobox"
        	url="plugins/combobox.swf" 
        	align="lefttop" 
        	x="10" 
        	y="10" 
        	width="150"
        	keep="true"
        	/>
	
	<action name="combobox:bell  Exterior">
    	loadpano(exterior_day.xml,null,MERGE,BLEND(1));
	</action>
	
		<action name="combobox:bell Interior Day">
    	loadpano(interior_day.xml,null,MERGE,BLEND(1));
	</action>

	<action name="combobox:bell  Interior Dusk">
    	loadpano(interior_night.xml,null,MERGE,BLEND(1));
	</action>



Andrew

Graydon

Profi

Beiträge: 614

Wohnort: Texas

Beruf: Industrial gas turbine services.

  • Nachricht senden

4

Montag, 25. Mai 2009, 07:48

Since your soundinterface plugin doesn't have keep=true... it looks like it should work as you have it coded.

How are you starting the sound in the first xml (exterior)... and what is in the other xml's to initiate the sound? An onloaded or similar?

I haven't used the soundinterface alot... so I can't say for sure where else a problem would be.

You may just have to change the combobox actions to first stop the existing sound, load the pano and then initiate a new sound.

The sample for the s2 hotspot here would be a basic template.

5

Montag, 25. Mai 2009, 19:58

Hi Graydon,

Thanks for the extra info. I never thought to add extra code to the combobox. I did a bit more hunting and reading and added stopallsounds(); and playsound(mymusik,exterior_running.mp3,loops); to the combobox area. Then it was just the case of changing the other entries for the other panoramas loaded with the combobox. I now have 5 panoramas and they all load their own allocated sound *g*

Quellcode

1
2
3
4
5
<action name="combobox:Bell Exterior">
    	stopallsounds();
    	loadpano(exterior_day.xml,null,MERGE,BLEND(1));
   	 playsound(mymusik,exterior_running.mp3,loops);
	</action>


All the best,

Andrew

6

Dienstag, 26. Mai 2009, 23:07

Andrew, give a link and we can check it ;-)
Marty

7

Mittwoch, 27. Mai 2009, 02:18

Completed

Hi Marty,

It's fixed.

I added the code in the post above after reading Graydon's posts and some more hunting around. It's for a client so only currently on their server. Will add a link once it's completed and live ;-)

Andrew