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.

hub

Trainee

  • "hub" started this thread

Posts: 118

Location: Annecy, France

  • Send private message

1

Monday, March 2nd 2009, 5:03pm

Sound button

I have an ambient sound in my pano that starts "onloaded". I wish to create a button to mute or to turn on the sound once again. here is my code that doesn't work. Can you tell me what's wrong in this script?

hub

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


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

<plugin name="btn_speaker_off" url="../../buttons/btn_speaker_off.png" visible="true" align="rightbottom" edge="rightbottom" y="10" x="110" alpha="0.7" onhover="showtext(couper son)" onover="set(alpha,1.0)" onout="set(alpha,0.7)"
onclick="action(mute); set(plugin[sound_off].visible,false); set(plugin[sound_on].visible,true)"/>
<plugin name="btn_speaker_on" url="../../buttons/btn_speaker_on.png" visible="false" align="rightbottom" edge="rightbottom" y="10" x="110" alpha="0.7" onhover="showtext(brancher son)" onover="set(alpha,1.0)" onout="set(alpha,0.7)"
onclick="action(play); set(plugin[sound_on].visible,false); set(plugin[sound_off].visible,true)"/>

<action name="mute">
stopsound(sound,depart.mp3)
</action>

Graydon

Professional

Posts: 614

Location: Texas

Occupation: Industrial gas turbine services.

  • Send private message

2

Monday, March 2nd 2009, 7:16pm

the stopsound function only needs the ID of the sound... and not the added file information...

Source code

1
2
3
4
5
original...
stopsound(sound,depart.mp3)

change to...
stopsound(sound)

hub

Trainee

  • "hub" started this thread

Posts: 118

Location: Annecy, France

  • Send private message

3

Tuesday, March 3rd 2009, 9:06am

Thank you! It works now.
May you explain me why it works with "soundinterface", but not with the "sound"? What is the difference beetween these plugins?

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

<plugin name="btn_speaker_on" url="../../buttons/btn_speaker_on.png" visible="false" align="rightbottom" edge="rightbottom" y="10" x="110" alpha="0.7" onhover="showtext(brancher son)" onover="set(alpha,1.0)" onout="set(alpha,0.7)"
onclick="action(play) "/>

<plugin name="btn_speaker_off" url="../../buttons/btn_speaker_off.png" visible="true" align="rightbottom" edge="rightbottom" y="10" x="110" alpha="0.7" onhover="showtext(couper son)" onover="set(alpha,1.0)" onout="set(alpha,0.7)"
onclick="action(mute) "/>

<action name="play">
playsound(sound,sound/depart.mp3); set(plugin[btn_speaker_on].visible,false); set(plugin[btn_speaker_off].visible,true);
</action>

<action name="mute">
stopsound(sound); set(plugin[btn_speaker_off].visible,false); set(plugin[btn_speaker_on].visible,true);
</action>

Graydon

Professional

Posts: 614

Location: Texas

Occupation: Industrial gas turbine services.

  • Send private message

4

Tuesday, March 3rd 2009, 5:24pm

the original sound.swf (http://www.krpano.com/plugins/sound/) was just designed to play and loop a sound file... it wasn't made to support the added functions of soundinterface.swf

I guess it could be considered an "alpha" release... created quickly and simple... so that users could incorporate sound.

Of course, only Klaus can answer in the definitive. *smile*

5

Tuesday, March 3rd 2009, 11:15pm

Would love to see a new sound plugin to load another XMl file for playlists; as well add play, pause, previous track, next track.

...well, at the very minimum, would like to see a pause feature instead of just enable (play) and disable (stop).

6

Wednesday, March 4th 2009, 11:07pm

more functions for the soundinterface plugin are coming soon
today I added functions for 3D directional sound,
here is a now a new separate folder for the soundinterface plugin

Posts: 2

Location: Russia

Occupation: Samara

  • Send private message

7

Saturday, August 25th 2012, 2:45pm

next \ previous track

Привет ребят.. Неужели до сих пор не реализованы в плагине soundinterface.swf команды перемотки треков (следующий\предыдущий трек)?.. ведь есть атрибут rootpath="" для нескольких треков =(
Hi guys .. Do not yet implemented in the plugin soundinterface.swf commands rewind track (next \ previous track)? .. because there is an attribute rootpath = "" for several tracks = (
let's funk *thumbup*

Similar threads