Switching ALL sounds with one button

Q&A about the latest versions
Post Reply
mhc1
Posts: 117
Joined: Sat May 02, 2009 10:51 pm
Location: bei Hamburg
Contact:

Hello @all ,

i am just lost within the sound- controls.

4 sound are loaded in the sound editor and not embedded, all static
(name is also the id, no sound in the skin editor)

1. buttonpress loop -1 action set to the controller container "on mouse click - play ..."
2. hsbuttonpress loop -1 action set on the hs-template "on mouse click play ..."
3. panoload loop 1 no further action set, should play WHILE pano loads
4. backmusik loaded as "background sound"

there is a sound- controller with a "sound on" and "sound off" function.
when clicked it sets the "_background" off and vise versa sets it on.

so far everything works pretty fine.

but:

the panoload music (3.) does not play while the pano loads, it plays when the pano is alreadyloaded.
also it does only play when the 1. pano loads, all further panos are quiet.
if i reload the appropriated html- file the sound is heard, to late again.

how can i switch ALL sound off with one button ?
i tried to stop/pause with the sound-control-button -> has no effect on 1. 2. 3., they are not active when i click the "sound off" button though.
also "_main" does not do the wanted effect. only "_background" can be switched on/off.


has anyone an idea ?

i just can rename the mp3- files so they are not heard anyhwo- but i want controll through the conroller.

hope i´m not too complicated.


edit:
the hotspots are linked to the according xxx.swf- file, not to a html file.
User avatar
Hopki
Gnome
Posts: 13025
Joined: Thu Jan 10, 2008 3:16 pm
Location: Layer de la Haye, Essex UK
Contact:

Hi
I am a little confused with what you are trying to do and where you are putting files.

Button clicks should be in the skin editor, normally these sounds are very small and do not add too much to the skin file size. As they are in the skin they will work in every panorama. This save having to add them to every p2vr project file so cutting down on download time. However if you what different click sounds per panorama, please see Static Sound below.

Background music, if you choose to embed the file it will play when the panorama has loaded, as well as adding to the files size of the SWF, if you choose Don't embed, the music will stream, in other words start playing while the panorama is also loading. This means you need the MP3 in the same folder and on the server as your SWF files.

Static sound: This only plays once when the panorama is first loaded if the loop is set to 1, of course how may times it play is dependent on the number of loops. Also depending if set to embed or not will determine when it first plays, while loading, don't embed, after loading, embed. Use this for initial startup sound for the panorama. Once played and exit and return, the sound will not restart. The only way to restart the sound is if it is set it to -1. then a play action will play the sound every time the button is clicked. If you want button click sounds to be different in each panorama then give all the sounds the same ID, say butt_click and set the loop to -1. You can now add different click sound per p2vr file, as long as the sound have the same ID the skin will just call for the play butt_click ID.

Surround Sound: As above but will replay every time the panorama is revisited. This is perfect for Narration for panoramas as the it will restart every time the panorama is opened.

For complete control over the sounds you will need to add change volume to individual sounds, then just use the set volume action, 0 and 1 to mute and play.

Example, I have a sounds in my project with ID's of: click, _background and hs_click. The click and hs_click are in the skin and the _bg is in the sound editor.
All the sound are set to level 0.5

Vol Up button.
Mouse Click > Play Sound > Loop 1 > Target: click
Mouse Click > Change Volume > Level: +.1 > Target: click
Mouse Click > Change Volume > Level: +.1 > Target: _background
Mouse Click > Change Volume > Level: +.1 > Target: hs_click

Vol Down button
Mouse Click > Play Sound > Loop 1 > Target: click
Mouse Click > Change Volume > Level: -.1 > Target: click
Mouse Click > Change Volume > Level: -.1 > Target: _background
Mouse Click > Change Volume > Level: -.1 > Target: hs_click

I then have two buttons stacked on top of each other, sound off and sound on.

Sound On button (set to visible)
Mouse Click > Play Sound > Loop:1 > Target: click
Mouse Click > Hide Element > Target: $self
Mouse Click > Show Element > Target: sound off
Mouse Click > Set Volume > Level: 0 > Target: _main
Mouse Click > Pause Sound > Target: _background

Sound Off button (set to not visible)
Mouse Click > Play Sound > Loop:1 > Target: click
Mouse Click > Hide Element > Target: $self
Mouse Click > Show Element > Target: sound on
Mouse Click > Set Volume > Level: 1 > Target: _main
Mouse Click > Play Sound > Loop: 0 > Target: _background

As you will see using the volume + and - buttons increments the individual sounds by 0.1 each click, if you like I am changing the sub volume of each sound within the main volume.

The mute button is setting all sounds to 0, main volume (_main)
Then Setting the main volume back to 1 mean you can here them all again. As the + and - buttons as changing the sub volumes, that means what ever you set the volumes to before you mute will be the same volume after the mute.

As I do not want the host computer processing the background music I have also added a pause to stop it from playing. You may conceder this for all continuos playing sounds, as even though the main volume is 0 the sound will other wise still be playing and using host resources.

See it in action here: http://www.hopkimedia.co.uk/sound

Background music plays while loading, startup sound after loading and once, project also contains the button click and hs_button click.

I hope this helps
Hopki
Garden Gnome Support
If you send an e-mail to support please send a link to the forum post for reference.
support@ggnome.com
https://ggnome.com/wiki/documentation/
mhc1
Posts: 117
Joined: Sat May 02, 2009 10:51 pm
Location: bei Hamburg
Contact:

Thanks for the reply Martin.

If I put them into the skin and the sound is active: it works like in your example.
I just don´t want to put all sound into the swf-file, there are 5 mp3s by now, they sum to app. 1.8 MB.
Also: if you want to change them its very easy just changing the file rather than going through
all files with Pano2VR, that should bee obviosu right ?

I just want to switch all sound OFF with one mouse-click.
As I said: background works, but all others don´t.

For "click"- usage:
I do use static sound with the settings "Loop = -1", so it´s not playing within the pano.
When i set an action to the button: the sound is playing and works just as i want it.
But i cannot switch it OFF !
Is there a trick to switch off all sound with one action ?

For pano- loading:
I do use static with the setting "Loop =1"

You advice me to set it to "Loop = -1" and then take an "Init" or "Reload" action in the skin- editor ?
Would this then play the loading-sound on every pano ?

I just tried that much that my hot-spot symbol doesn´t show up no more - the standard red circle is shown instead of my image which i set in the skin- editor. Strange but tha´t i can fix when
i just have no sound action set in the skin- editor.


I have to try "Set volume level 0" for "_main" - may be this disables all sound.
mhc1
Posts: 117
Joined: Sat May 02, 2009 10:51 pm
Location: bei Hamburg
Contact:

Yes Martin,
thank you so much !!!!


Working with the "Set Volume xxx" and "_main" is the solution !
I have to try a little, but when i set the "_main" to "0"- ALL sound is off.

That was it !

Thanks again.
User avatar
Hopki
Gnome
Posts: 13025
Joined: Thu Jan 10, 2008 3:16 pm
Location: Layer de la Haye, Essex UK
Contact:

Hi
Glad yo got it going, yes setting an Init play sound action crashes the skin, loaded and reload works well.
Not sure if this is a bug as such but the fact it does it I suppose it is.
I will see if its been reported, if not I will add it to the list.
Hopki
Garden Gnome Support
If you send an e-mail to support please send a link to the forum post for reference.
support@ggnome.com
https://ggnome.com/wiki/documentation/
mhc1
Posts: 117
Joined: Sat May 02, 2009 10:51 pm
Location: bei Hamburg
Contact:

I didn´t find an issue about this crash.
Also did I not investigate when it actually happens, only when actions are set to sound-id´s from the sound editor with external mp3 i guess.

I fortunately had a project & skin that was only 1 step before the crash, so i just deleted the faulty one and used the version before.
Think you´ll have a hell of a lot of work if this happend just in the end of your work and you don´t know exactly why !
Post Reply