How to toggle between audios files?

Q&A about the latest versions
Post Reply
User avatar
KRitchie
Posts: 59
Joined: Tue Apr 21, 2020 10:59 am
Location: Philadelphia, PA

I have a tour that has 7 polygon hot spots in one node. Each of the hotspots triggers an mp3 to play via a proxy ID. I have it set to mouse click, play/stop media. The issue is if I press polygon #1 it plays mp3 #1. Then if I press polygon #2, mp3 #2 starts, and now both audio files are playing.

How can I stop the other audio files when I click on a polygon hotspot, to activate that audio track? I only want to be able to hear 1 audio file at a time.

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

Hi Kevin,
See the attached project.
It is set up to work with point hotspots. But you can use the actions in the video element and still use the Hotspot Proxy ID.
This was when the polygon is selected the audio file is replaced.

Of if you're using dircetional sound, and a container then add the action, Mouse Down, Stop Media first, then Mouse Click Play media.
A Click is activated on mouse up.
Regards,
Attachments
project.zip
(34.17 KiB) Downloaded 158 times
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/
User avatar
KRitchie
Posts: 59
Joined: Tue Apr 21, 2020 10:59 am
Location: Philadelphia, PA

Thanks so much Hopki. I never thought of using the video container to play audio files. I was definitely over complicating things.

- Kevin
User avatar
KRitchie
Posts: 59
Joined: Tue Apr 21, 2020 10:59 am
Location: Philadelphia, PA

Hi Hopki, I am revisiting this project and need to add a pause functionality to it. I have 3 audio files approx :30 long. I would like to click on it to start the mp3 file, but then click on it again to pause the media.

I have tried changing it from Play Media to Play/Pause Media, but that is not working.

Any ideas?

- Kevin
User avatar
Hopki
Gnome
Posts: 13021
Joined: Thu Jan 10, 2008 3:16 pm
Location: Layer de la Haye, Essex UK
Contact:

Hi Kevin,
Sorry for the delay, I have given it a mod.
I have added a true/false variable to the skin.
The hotspot sets this to true on click and the video element sets it back to false when media ended.
The reason why the Play/Pause action did not work was that it's calling the sound to play with each click.
So the action to load the sound now has an action filter that says if the variable is true, do not call the sound to play.
So now the Play/Pause button works.
Regards,
Attachments
project.zip
(35.29 KiB) Downloaded 122 times
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/
User avatar
KRitchie
Posts: 59
Joined: Tue Apr 21, 2020 10:59 am
Location: Philadelphia, PA

Hi Hopki, thanks for adding that variable. The one issue I am still having is that if you have 3 audio hotspots, like in your sample - if you click on say hotspot one, it activates an audio clip. Clicking on any of the three hotspots will pause and resume that clip now. I was hoping to have hotspot 2 or 3 trigger a new audio clip. I know it would be very hard to have this work with pause functionality because you would be calling switching between 3 audio files. I have fine with losing pause and just having the audio stop.

So it would be a play/stop toggle for all the hotspots

- Kevin
Post Reply