You are not logged in.

  • "jeremyfukunaga" started this thread

Posts: 25

Location: Oakland, CA

Occupation: Photographer

  • Send private message

1

Thursday, February 20th 2020, 6:25am

Different sound for each scene

Hello,

I'm hoping to get some instruction on having a different mp3 for each scene. Basically, I have a nature tour and purchased various sounds for the various outdoor settings.

Also, I set loops="0" but the sound keeps stopping.

Thanks in advance for any help.

- Jeremy

This post has been edited 1 times, last edit by "jeremyfukunaga" (Feb 20th 2020, 8:24am)


Tuur

Sage

Posts: 3,281

Location: Netherlands

Occupation: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer

  • Send private message

spacerywirtualne

Professional

Posts: 958

Location: Poland, Europe

Occupation: krpano developer : virtual tours

  • Send private message

3

Thursday, February 20th 2020, 12:28pm

Sounds familiar *thumbsup*
Your own online, cloud tool for creating virtual tours - www.cms4vr.com

facebook page :: youtube

cms4vr team *thumbsup*

Tuur

Sage

Posts: 3,281

Location: Netherlands

Occupation: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer

  • Send private message

4

Thursday, February 20th 2020, 1:14pm

Ah yes..
I didn’t realize.
Sorry!
Just cleaned up the laptop and searched for short mp3’s on my system.
If you like i can change the audio files.

Audio credits in the example come from the html5 vr audio plugin:
https://krpano.com/plugins/userplugins/html5vraudio/#top

Tuur *thumbsup*
http://www.virtualtuur.com
Skype:studiotuur

spacerywirtualne

Professional

Posts: 958

Location: Poland, Europe

Occupation: krpano developer : virtual tours

  • Send private message

5

Thursday, February 20th 2020, 3:08pm

You didn't have to do this Tuur. I was happy.
Your own online, cloud tool for creating virtual tours - www.cms4vr.com

facebook page :: youtube

cms4vr team *thumbsup*

vrTourSoft

Beginner

Posts: 42

Occupation: Software development

  • Send private message

6

Thursday, February 20th 2020, 4:25pm

I'm hoping to get some instruction on having a different mp3 for each scene. Basically, I have a nature tour and purchased various sounds for the various outdoor settings.
Hi!
Look here. It can help you.
In vrTourSoft you can add scene sound to each panorama.
  • This feature allows you to add a separate sound to each panorama. For example audio guide..
  • The program converts the original sound into the required file formats (.mp3, .ogg) and copy them on tour.
  • The program add the necessary code to play the sound.
  • It will create a button in the extraskin that will turn the sound on/off. This button will appears only if the sound is exist in the panorama.
  • You can select the number of repeats.




Read more https://www.vrtoursoft.com/editors/scenesettings.html#sound
vrTourSoft - standalone WYSIWYG editor and development environment for krpano
https://www.vrtoursoft.com/

  • "jeremyfukunaga" started this thread

Posts: 25

Location: Oakland, CA

Occupation: Photographer

  • Send private message

7

Friday, February 21st 2020, 6:52am

Thank you so much for your response. Unfortunately, I am still having trouble implementing you examples. Perhaps if I provide the code I am working with it will help? Let's say I want to add audio1.mp3 to the first scene, audio2.mp3 to the second scene, and audio3.mp3 to the third scene. How would you do it?




<krpano version="1.20" title="Virtual Tour">

<!-- flare_dir: var with the address of the lensflare folder -->
<krpano flare_dir="skin/lensflare" />

<include url="skin/lensflare/core.xml" />
<include url="skin/vtourskin.xml" />

<!-- customize skin settings: maps, gyro, webvr, thumbnails, tooltips, layout, design, ... -->
<skin_settings maps="true"
maps_type="google"
maps_bing_api_key=""
maps_google_api_key=""
maps_zoombuttons="false"
maps_loadonfirstuse="true"
gyro="true"
gyro_keeplookingdirection="false"
webvr="false"
webvr_keeplookingdirection="true"
webvr_prev_next_hotspots="true"
autotour="false"
littleplanetintro="false"
followmousecontrol="false"
title="false"
thumbs="true"
thumbs_width="120" thumbs_height="80" thumbs_padding="10" thumbs_crop="0|40|240|160"
thumbs_opened="false"
thumbs_text="false"
thumbs_dragging="true"
thumbs_onhoverscrolling="false"
thumbs_scrollbuttons="false"
thumbs_scrollindicator="false"
thumbs_loop="false"
tooltips_buttons="true"
tooltips_thumbs="false"
tooltips_hotspots="false"
tooltips_mapspots="false"
deeplinking="false"
loadscene_flags="MERGE"
loadscene_blend="OPENBLEND(0.5, 0.0, 0.75, 0.05, linear)"
loadscene_blend_prev="SLIDEBLEND(0.5, 180, 0.75, linear)"
loadscene_blend_next="SLIDEBLEND(0.5, 0, 0.75, linear)"
loadingtext="loading..."
layout_width="100%"
layout_maxwidth="814"
controlbar_width="-24"
controlbar_height="40"
controlbar_offset="20"
controlbar_offset_closed="-40"
controlbar_overlap.no-fractionalscaling="10"
controlbar_overlap.fractionalscaling="0"
design_skin_images="vtourskin_light2.png"
design_bgcolor="0x000000"
design_bgalpha="0.8"
design_bgborder="0"
design_bgroundedge="1"
design_bgshadow="0 4 10 0x000000 0.3"
design_thumbborder_bgborder="3 0xFFFFFF 1.0"
design_thumbborder_padding="2"
design_thumbborder_bgroundedge="0"
design_text_css="color:#FFFFFF; font-family:Arial;"
design_text_shadow="1"
/>

<!--
For an alternative skin design either change the <skin_settings> values
from above or optionally include one of the predefined designs from below.
-->
<!-- <include url="skin/vtourskin_design_flat_light.xml" /> -->
<!-- <include url="skin/vtourskin_design_glass.xml" /> -->
<!-- <include url="skin/vtourskin_design_ultra_light.xml" /> -->
<!-- <include url="skin/vtourskin_design_117.xml" /> -->
<!-- <include url="skin/vtourskin_design_117round.xml" /> -->
<!-- <include url="skin/vtourskin_design_black.xml" /> -->


<!-- startup action - load the first scene -->
<action name="startup" autorun="onstart">
if(startscene === null OR !scene[get(startscene)], copy(startscene,scene[0].name); );
loadscene(get(startscene), null, MERGE);
if(startactions !== null, startactions() );
</action>



<scene name="scene_004033_panorama" title="004033_panorama" onstart="" thumburl="panos/004033_panorama.tiles/thumb.jpg" lat="" lng="" heading="">

<view hlookat="0.0" vlookat="0.0" fovtype="MFOV" fov="120" maxpixelzoom="1.0" fovmin="70" fovmax="140" limitview="auto" />

<preview url="panos/004033_panorama.tiles/preview.jpg" />

<image>
<cube url="panos/004033_panorama.tiles/%s/l%l/%v/l%l_%s_%v_%h.jpg" multires="512,1024,2048,3840" />
</image>

</scene>

<scene name="scene_004083_panorama" title="004083_panorama" onstart="" thumburl="panos/004083_panorama.tiles/thumb.jpg" lat="" lng="" heading="" sound="meadow_ambience">

<view hlookat="0.0" vlookat="0.0" fovtype="MFOV" fov="120" maxpixelzoom="1.0" fovmin="70" fovmax="140" limitview="auto" />

<preview url="panos/004083_panorama.tiles/preview.jpg" />

<image>
<cube url="panos/004083_panorama.tiles/%s/l%l/%v/l%l_%s_%v_%h.jpg" multires="512,1024,2048,3840" />
</image>

</scene>



<scene name="scene_004108_panorama" title="004108_panorama" onstart="" thumburl="panos/004108_panorama.tiles/thumb.jpg" lat="" lng="" heading="">

<view hlookat="0.0" vlookat="0.0" fovtype="MFOV" fov="120" maxpixelzoom="1.0" fovmin="70" fovmax="140" limitview="auto" />

<preview url="panos/004108_panorama.tiles/preview.jpg" />

<image>
<cube url="panos/004108_panorama.tiles/%s/l%l/%v/l%l_%s_%v_%h.jpg" multires="512,1024,2048,3840" />
</image>

</scene>

<autorotate enabled="true"
waittime="1.0"
speed="2.0"
horizon="0.0"
tofov="120.0"
/>

<plugin name="soundinterface"
keep="true"
url.flash="plugins/soundinterface.swf"
url.html5="plugins/soundinterface.js"
preload="true"
rootpath="audio"
volume="1.0"
mute="false"
loops="0"
/>

</krpano>

Tuur

Sage

Posts: 3,281

Location: Netherlands

Occupation: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer

  • Send private message

8

Friday, February 21st 2020, 11:19am

Hi,

first add this to the code:

Source code

1
2
3
4
5
    <events name="audioscene" keep="true" onnewscene="ChangeScene();" />
	<action name="ChangeScene">
        calc(_audiourl, 'audio/' + scene[get(xml.scene)].sound + '.mp3');
        playsound(curaudio, get(_audiourl));
	</action>


when you use the 'rootpath' setting in the soundinterface plugin (audio in your case) then you should change
calc(_audiourl, 'audio/' + scene[get(xml.scene)].sound + '.mp3');
to
calc(_audiourl, scene[get(xml.scene)].sound + '.mp3');

in every scene you should add:
sound="YOUR AUDIO FILE NAME" (audio1 for example)
like:
<scene name="scene_004033_panorama" title="004033_panorama" onstart="" sound="audio1" thumburl="panos/004033_panorama.tiles/thumb.jpg" lat="" lng="" heading="" >

i use sound in this case (sound) but you can also use 'labrador' or 'tulip' of course ;-)

Hope it helps,
Tuur *thumbsup*
http://www.virtualtuur.com
Skype:studiotuur

  • "jeremyfukunaga" started this thread

Posts: 25

Location: Oakland, CA

Occupation: Photographer

  • Send private message

9

Saturday, February 22nd 2020, 6:16am

Hi Tuur,

You are the master!! Thank you so much -- it worked! I hope to understand what the code means one day. For now, I just copied and pasted.

One other thing, if I may. The sound does not seem to loop. I thought setting the loops value to 0 makes it endless, but it plays just once. Any ideas?

Tuur

Sage

Posts: 3,281

Location: Netherlands

Occupation: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer

  • Send private message

10

Saturday, February 22nd 2020, 8:41am

Try playsound(curaudio, get(_audiourl), true);

Not tested, i’m on phone now
Tuur *thumbsup*
http://www.virtualtuur.com
Skype:studiotuur

11

Saturday, February 22nd 2020, 9:52am

@jeremy

-->

https://krpano.com/plugins/soundinterface/#playsound

the documentation it is really good ;-)

  • "jeremyfukunaga" started this thread

Posts: 25

Location: Oakland, CA

Occupation: Photographer

  • Send private message

12

Saturday, February 22nd 2020, 11:55pm

Try playsound(curaudio, get(_audiourl), true);

Not tested, i’m on phone now
Tuur *thumbsup*
That worked perfectly. I can't thank you enough, Tuur!!

I will publish the tour soon if you are interested in viewing it!

Best,

Jeremy