Add a sound file as a audio guide

Q&A about the latest versions
Post Reply
User avatar
videonice
Posts: 9
Joined: Mon Nov 30, 2020 12:53 pm
Contact:

Hello to everybody,
I need to know in which way I can add in the virtual tour a button that play an audio guide file also the normal info text box pop-up.
Best regards Marco
User avatar
Hopki
Gnome
Posts: 13005
Joined: Thu Jan 10, 2008 3:16 pm
Location: Layer de la Haye, Essex UK
Contact:

Hi Marco,
Can you be more specific on your requirements?
You say play an audio guide file, just for the one node of fore a complete tour?
Will you be using Animation for a guided tour?.
Regards,
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
videonice
Posts: 9
Joined: Mon Nov 30, 2020 12:53 pm
Contact:

Hi Hopki,

thanks for you help, in addition to the classic info text button, I have to insert a button that starts an audio guide that reads the same text.
In which way can I do this?
Regards Marco
User avatar
Hopki
Gnome
Posts: 13005
Joined: Thu Jan 10, 2008 3:16 pm
Location: Layer de la Haye, Essex UK
Contact:

Hi Marco,
You can use mp3 files but if you just want to read out text then why not use the text to speech component?
This is found in the components toolbox.
Also see this video: https://youtu.be/mjKsG5kbMqE
Please see this page for options: viewtopic.php?f=22&t=15261
Regards,
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
videonice
Posts: 9
Joined: Mon Nov 30, 2020 12:53 pm
Contact:

Hi Hopki,
thanks for your interesting suggestions, for my new project my real need is to add an mp3 file with the voice of a professional speaker reading the text. In a nutshell, the tour also includes text boxes and audio file players.
Could you please explain to me how I can insert an mp3 file with its star / stop button?
Thanks again for your help
Regards Marco
User avatar
Hopki
Gnome
Posts: 13005
Joined: Thu Jan 10, 2008 3:16 pm
Location: Layer de la Haye, Essex UK
Contact:

Please find attached a project that when you click the point hotspot it starts an mp3 file.
This project has all the mp3 files added to the HTML5 output assets and uses a video element to play them.
This has the advantage that the seek bar can be used with the video element and allows play pause and seek of the audio.

The hotspot also allows play and pause, as well as clicking another hotspot to start a different mp3 file.
No node change in the mp3 file is stopped.

How the point hotspot works is by using the variable value as a comparator.
Have a look at the text box ht_audio_button, this is found as a child of the ht_audio hotspot template.

It has the action to set the point hotspots description text to Video 1. The text is the file path to the mp3 it should play.
The next action sets the Variable Value using the hotspot description text, so the file path is now in the variable "active_snd".
The next action play/pause the Video 1 element.

So how this works is when you click the point hotspot the path to the mp3 is set to the Video 1 element.
The variable then gets the path to the mp3, so this is now in the actiave_snd variable.
The next action plays the Video 1 element. Note the Play/Pause action will always play a new file but play/pause an existing file.
So on second click the action filter in the first action, Set Value looks at the contents of the point hotspots description text field and compares it with the variable value. If they are the same then the action is not triggered. So the play/pause button sees it as an existing file and pauses it.

If you click a different pointy hotspot, the action filter will see that the description file path and the variable values are not the same so will add the new path the to Video 1 element. In doing so the play/pause action see this as a new file and plays the sound.

The actions need to be in the text box and not the hotspot template because the hotspot also has a stop button.
So there is no conflict with the play sound and stop sound they are on the same level in the skin editors file tree.
Regards,
Attachments
project.zip
(180.74 KiB) Downloaded 148 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
videonice
Posts: 9
Joined: Mon Nov 30, 2020 12:53 pm
Contact:

Hi Hopki,
thanks for your help, I try and I'll give you back information asap.
Regards
illjo
Posts: 4
Joined: Thu Dec 30, 2021 3:55 pm

Hi Martin,

how can I add the sound file to the ht_audio that you show in this project?
I don't understand your explanation, sorry. And it seems to be very complicated.

- I copied the ht_audio and the Folder "media_controls" to my project.

- The ht_audio on your sample project is a URL type. So I The mp3 is located in the folder "media" in the Pano2VR output. So I set the text in the description to "media/" plus the mp3 file name.

- the audio file doesnot start to play when clicking on the hotspot.

- I tried mp3 and mp4, both don't work. I also tried changing the hotspot type to video.

What might be my fault?

Image

Thanks!




Hopki wrote: Fri Nov 12, 2021 12:11 pm Please find attached a project that when you click the point hotspot it starts an mp3 file.
This project has all the mp3 files added to the HTML5 output assets and uses a video element to play them.
This has the advantage that the seek bar can be used with the video element and allows play pause and seek of the audio.

The hotspot also allows play and pause, as well as clicking another hotspot to start a different mp3 file.
No node change in the mp3 file is stopped.

How the point hotspot works is by using the variable value as a comparator.
Have a look at the text box ht_audio_button, this is found as a child of the ht_audio hotspot template.

It has the action to set the point hotspots description text to Video 1. The text is the file path to the mp3 it should play.
The next action sets the Variable Value using the hotspot description text, so the file path is now in the variable "active_snd".
The next action play/pause the Video 1 element.

So how this works is when you click the point hotspot the path to the mp3 is set to the Video 1 element.
The variable then gets the path to the mp3, so this is now in the actiave_snd variable.
The next action plays the Video 1 element. Note the Play/Pause action will always play a new file but play/pause an existing file.
So on second click the action filter in the first action, Set Value looks at the contents of the point hotspots description text field and compares it with the variable value. If they are the same then the action is not triggered. So the play/pause button sees it as an existing file and pauses it.

If you click a different pointy hotspot, the action filter will see that the description file path and the variable values are not the same so will add the new path the to Video 1 element. In doing so the play/pause action see this as a new file and plays the sound.

The actions need to be in the text box and not the hotspot template because the hotspot also has a stop button.
So there is no conflict with the play sound and stop sound they are on the same level in the skin editors file tree.
Regards,
Attachments
Bildschirmfoto 2022-01-18 um 13.25.46.png
Bildschirmfoto 2022-01-18 um 13.25.46.png (1.23 MiB) Viewed 1362 times
User avatar
Hopki
Gnome
Posts: 13005
Joined: Thu Jan 10, 2008 3:16 pm
Location: Layer de la Haye, Essex UK
Contact:

Hi,
The project was designed to give quite a lot of function with just a point hotspot, so clicking the text box would play and pause and the stop button would stop and start the sound from the beginning.
The element Video 1 is used to play the MP3 file, so it is hidden in the skin.
All the MP3 files are added to the project as assets as found under the HTML5 outputs Advanced tab, in the output the MP3 files will be placed in a subfolder called "assets".

So to get the video element to play an MP3 file you need two actions, the first is to set the path to the file you want to play.
For example, Mouse Click, Set Value, URL: assets/vo1.mp3, Target Video 1.
The next is to play the MP3 so it will be Mouse Click, Play/Pause Media, Loop1, Video 1.

There was a little more trickery so when you click around different sound point hotspots they stopped and only played the one you want.
If you are struggling then please send in your project to support, link below.
Regards,
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/
Post Reply