Re: Audio - is it possible?

156 views
Skip to first unread message
Message has been deleted

Joost

unread,
Feb 26, 2024, 2:50:31 AM2/26/24
to marz...@googlegroups.com
Hello,

The sky is the limit. Sure it is possible to add buttons that play audio. I can dive into this challenge later this week but questions on forehand:
- Do you have an idea how you want to play the audio? Do you have sound(MP3/wav/etc.) files? Or are you looking for a tool that converts text to speech? Having MP3's is easier than a text-to-speech conversion.
- Are you using the standard InfoSpots that Marzipano implements?

greetings,
Joost

Op vr 23 feb 2024 om 16:41 schreef GrownWarry <sameerw...@gmail.com>:
I have made a tour and hosted it myself, I would like to add both text and audio to my tour for those who have disabilities. Is it possible to add audio to hotspots? Or is it possible to make a play button that plays the audio?

--
You received this message because you are subscribed to the Google Groups "marzipano" group.
To unsubscribe from this group and stop receiving emails from it, send an email to marzipano+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/marzipano/11f48276-5cb2-47b1-8695-25deb6ac90c8n%40googlegroups.com.
Message has been deleted

Mortech GH

unread,
Feb 23, 2026, 5:58:36 AMFeb 23
to marzipano
any source code for implementing audio in marzipano ,so that it  plays at the background

Joost

unread,
Feb 24, 2026, 3:42:01 PMFeb 24
to marz...@googlegroups.com
Hello,

In one of my escape rooms I have implemented an audio system that plays background audio based on the scene you are in.
For this I use the JS library called "Howler.JS". It's very small and easy to use.

Example part of my escape room: https://www.dustveilsaloon.com/part3_1805202110/

Look in the source, just at the <body> tag. Under the <body> tag I added;
<script src="https://cdnjs.cloudflare.com/ajax/libs/howler/2.2.1/howler.min.js"></script>   
<!-- This is the link to Howler library. You can also download it and place it on your website, I have added it as link -->

Under <div id="pano"></div> I added:
<script src="audio-manager.js"></script>
<script>
var myCurrentScene = "";
function setMusic() {
audioManager.update(myCurrentScene);
}
</script>

I place three audio files in a sounds directory called: wind.mp3, inside.mp3, piano.mp3
I created a JS file called audio-manager.js. View it here: https://www.dustveilsaloon.com/part3_1805202110/audio-manager.js
In the audio-manager I defined the sounds I want to hear per scene, as well as the volume.

Now every time you switch scene if fades out / in into the new music. It only switched the music if the target scene has another music set.


Hope this script helps!

greetings,
Joost


Op ma 23 feb 2026 om 11:58 schreef Mortech GH <mort...@gmail.com>:

Joost

unread,
Feb 24, 2026, 3:47:41 PMFeb 24
to marz...@googlegroups.com
forgot to mention you have to change the index.js a bit to set the scene. Add the two parent. lines.
  function updateSceneName(scene) {
    sceneNameElement.innerHTML = sanitize(scene.data.name);
    window.marzipano_viewer = viewer;
	
	parent.myCurrentScene = scene.data.name;
	parent.setMusic();
  }
  

Op di 24 feb 2026 om 21:41 schreef Joost <joostva...@gmail.com>:
Reply all
Reply to author
Forward
0 new messages