PDA

View Full Version : Sound Control on mp3hotspot plugin


HansNyberg
11-22-2007, 06:17 AM
The new mp3hotspot plugin Denis posted a couple of days ago is just great.
You can now easy ad individual audio with directional sound on each pano in a tour.
You can even ad several sounds in 1 pano.

However how do I connect this to a soundcontrol in the toolbar.
I just want to have a global on/off control.

I have just a simple button like this
<spot id="audio" static="1" salign="RT" staticX="-220" staticY="20" url="controller/sound.png" />

I tried duplicating the autorotation button and do this but that does not work.
<spot id="audio" static="1" salign="RT" staticX="-220" staticY="20" url="controller/sound.png" onClick="external.mp3hotspot.disabled+=0" />

Hans

HansNyberg
11-22-2007, 07:41 AM
Ok I managed to find out this myself.
This works for turning off the sound.
Whats the command for on/off ?
Would be nice with on off with some transition.

Apparently I can not command all the sounds with one control. I tried just using one and calling all the sounds id=audio1 but that only worked for the first of them. I have to use a linked controlbutton.

<spot id="audio" static="1" salign="RT" linked="images/1" staticX="-220" staticY="20" url="controller/sound.png" onClick="audio1.soundVolume=0" />
<spot id="audio" static="1" salign="RT" linked="images/2" staticX="-220" staticY="20" url="controller/sound.png" onClick="audio2.soundVolume=0" />
<spot id="audio" static="1" salign="RT" linked="images/3" staticX="-220" staticY="20" url="controller/sound.png" onClick="audio3.soundVolume=0" />



<spot id="audio1" url="files/mp3hotspot.swf" file="files/audio1.mp3" linked="images/1" repeat="0" pan="-100" tilt="-20" enableSoundPannig="1" soundRadius="200" />
<spot id="audio2" url="files/mp3hotspot.swf" file="files/audio2.mp3" linked="images/2" repeat="1000" pan="100" tilt="-20" enableSoundPannig="1" soundRadius="200" />
<spot id="audio3" url="files/mp3hotspot.swf" file="files/audio3.mp3" linked="images/3" repeat="1000" pan="-100" tilt="-20" enableSoundPannig="1" soundRadius="200" />

Hans

HansNyberg
11-23-2007, 07:53 AM
As no one seems to be able to solve this I done it my way.
I just added mouse over for starting the sound again. However it must be a better solution. This one does not work in Safari fullscreen because of the mouseover bug.
<spot id="audio" static="1" salign="RT" linked="images/1" staticX="-220" staticY="20" url="controller/sound.png" onclick="audio1.soundVolume=0" onover="audio1.soundVolume=1" />

Hans

cheathamlane
11-23-2007, 03:10 PM
As no one seems to be able to solve this I done it my way.
I just added mouse over for starting the sound again. However it must be a better solution. This one does not work in Safari fullscreen because of the mouseover bug.
<spot id="audio" static="1" salign="RT" linked="images/1" staticX="-220" staticY="20" url="controller/sound.png" onclick="audio1.soundVolume=0" onover="audio1.soundVolume=1" />

Hans

Hey Hans:

Instead of:
onclick="audio1.soundVolume=0" onover="audio1.soundVolume=1"

Why don't you try something like:

<spot
id="audio" static="1" salign="RT" linked="images/1" staticX="-220" staticY="20"
url="controller/sound.png"

onclick="makeSoundGoOff;"

makeSoundGoOff ="audio1.soundVolume=0;onClick=makeSoundGoOn;"
makeSoundGoOn ="audio1.soundVolume=1;onClick=makeSoundGoOff;"
/>

HansNyberg
11-24-2007, 02:35 PM
Thanks Patrick

It works, at least with linked panoramas.
It does not work as a global on/off for several panoramas using 1 id.
Also I can not get it to work for 2 soundfiles in one pano.

Hans

cheathamlane
11-24-2007, 04:48 PM
Thanks Patrick

It works, at least with linked panoramas.
It does not work as a global on/off for several panoramas using 1 id.
Also I can not get it to work for 2 soundfiles in one pano.

Hans

Hans:

Why are you using one ID? You will be much, much happier in the long run to use separate IDs, if you're handcoding your FPP/XML. I'm not surprised you're having trouble, using the same ID for multiple elements.

Similar to the functions I supplied you, you could write functions and put them in <global/>, and they could handle multiple soundfiles.

HansNyberg
11-24-2007, 05:27 PM
The reason why I wanted to be able to do it is that I find it important that people can set the sound to on/off for the whole tour if they want.
Without getting the sound again at next pano
In Fullscreen mode you have no access to your system soundcontrol

Hans

zleifr
11-24-2007, 05:30 PM
Hans:

Patrick is very right about using the same ID on multiple elements. It is almost certain to cause you some problem eventually, as conceptually an id is unique, and therefore, it would be unusual for a program to be designed to handle multiple items with the same id, and even when it works, it is likely that it won't work completely.

Just use a different id on each item, you will be much happier in the long run.

HansNyberg
11-24-2007, 05:33 PM
And as I said your code does not work if you have multiple sounds in one pano. Which is a very nice feature with the mp3hotspot BTW

Even if I put 2 IDs on these files.

Hans

adriansalisbury
12-06-2007, 10:03 AM
Thanks guys, this has answered some questions for me.

I agree with Hans though that it seems a long way round though. With the flvplayer I could simply put onClick="soundVolume=+=0", is that not a standard term that can be used here? Do we really have to write so much code :-(