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.

matrekker

Intermediate

  • "matrekker" started this thread

Posts: 204

Location: Aix-les-bains

  • Send private message

1

Monday, June 22nd 2009, 10:54am

Sound that starts immediately

I never watched this question over, but I have a problem now whith something very simple in fact :

I would like that my sound starts immediately without waiting for the end for loading of the visit. Exactly like this :


http://www.visites-interactives.eu/fr/vi…voie/index.html

I precise that in this example, the sound is included as a separate file so it starts with the opening of the html page and it's ok.

But now, I would like the buttons ON THE VISIT with a simultaneous start of the sound with the opening of the html page. All what I found is always "onloaded" and if I replace by "onstart", it does not work of course.

So, how should I write correctly this code :

<plugin name="soundinterface"
url="plugins/soundinterface.swf"
rootpath="sound"
onloaded="action(play)"
/>

<action name="play">
playsound(sound,son.mp3,0);
</action>

<action name="mute">
stopsound(sound)
</action>

<plugin name="off" url="images/off.png" visible="true" align="leftbottom" edge="leftbottom" y="10" x="156" alpha="1.0" onhover="showtext(stop the sound)" onover="set(alpha,0.7)" onout="set(alpha,1.0)"
onclick="action(mute); set(plugin[sound_off].visible,false); set(plugin[sound_on].visible,true)"/>

<plugin name="on" url="images/on.png" visible="true" align="leftbottom" edge="leftbottom" y="10" x="126" alpha="1.0" onhover="showtext(sound on)" onover="set(alpha,0.7)" onout="set(alpha,1.0)"
onclick="action(play); set(plugin[sound_on].visible,false); set(plugin[sound_off].visible,true)"/>



Thank you for your help.



Ma *smile*

2

Monday, June 22nd 2009, 11:00am

Source code

1
2
3
4
5
<plugin name="soundinterface" 
url="plugins/soundinterface.swf" 
rootpath="sound" 
onloaded="playsound3D(auto,yourfile.mp3, 0, 0, 360, 1.0, loops);" 
/> 


try with this code *rolleyes* it's working well

This post has been edited 1 times, last edit by "Job.1" (Jun 22nd 2009, 12:12pm)


3

Monday, June 22nd 2009, 11:02am

to stop sound

Source code

1
2
3
<action name="mute">
		stopallsounds();
	</action>

matrekker

Intermediate

  • "matrekker" started this thread

Posts: 204

Location: Aix-les-bains

  • Send private message

4

Monday, June 22nd 2009, 11:10am

Thanks a lot, I try this code in a few minutes.

See you later,

Ma

5

Monday, June 22nd 2009, 11:17am

Hi,

to start the sound as soon as possible - use the latest krpano version and try this:

Source code

1
2
3
<plugin name="soundinterface" url="plugins/soundinterface.swf" rootpath="sound" 
        preload="true"
        />


and then start the sound in onstart:

Source code

1
<krpano ... onstart="playsound(...);">


note the - preload="true" - setting, this forces the plugin to be loaded before the pano,
but in this case the "onloaded" event can't be used, instead of it "onstart" can be used,

best regards,
Klaus

matrekker

Intermediate

  • "matrekker" started this thread

Posts: 204

Location: Aix-les-bains

  • Send private message

6

Monday, June 22nd 2009, 11:29am

Job1 : unfortunately, it doesn't start the sound BEFORE.

Klaus : I will try your tip and tell you later if I succeeded.

Thanks to both of you.



Ma

matrekker

Intermediate

  • "matrekker" started this thread

Posts: 204

Location: Aix-les-bains

  • Send private message

7

Monday, June 22nd 2009, 12:23pm

Job 1 :

Magnifique, à force de tourner et de retourner, de mettre un peu du tien, de Klaus et un peu de trucs à moi ça marche enfin comme je voulais. Merci.

Klaus :

It works, many thanks but I had to make many many changes at different levels of my whole code.

It's cool, now the sound can start immediately or later when the files are loaded. Good day for me !

Ma *thumbup*

matrekker

Intermediate

  • "matrekker" started this thread

Posts: 204

Location: Aix-les-bains

  • Send private message

8

Monday, June 22nd 2009, 1:38pm

It works exactly as I wanted (sound starts immediately and the buttons are ON the visit) :

http://www.visites-interactives.eu/fr/vi…voie/index.html

Now, what about "pause (or break) button" and "volume (sound level) button" ? Is there a program for those buttons with Krpano ?



Ma

9

Tuesday, June 23rd 2009, 10:16am

It works exactly as I wanted (sound starts immediately and the buttons are ON the visit) :

http://www.visites-interactives.eu/fr/vi…voie/index.html

Now, what about "pause (or break) button" and "volume (sound level) button" ? Is there a program for those buttons with Krpano ?

Ma
Hi, currently only stopping a sound is possible (via stopsound()),
more control/functions soon,

best regards,
Klaus

Similar threads