You are not logged in.

Dear visitor, welcome to krpano.com Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Wednesday, August 17th 2016, 2:34pm

directional sound in Video Hotspots - HTML5

Hi
I needed my video hotspots to have directional sound under VR so i used this


Source code

1
2
3
4
5
6
7
8
9
10
<!-- put those lines under hotspot -->
 <events name="hotspot_name_3dsound" keep="false" onviewchange="viewaction(hotspot_name)"/>
 <action name="viewaction">
    getlooktodistance(hotspot_dist, hotspot[%1].ath, hotspot[%1].atv);
    set(new_volume, 0.8);   <!-- 0.8 - maximum volume -->
    div(hotspot_dist, 130);  <!-- 130 - range -->
    sub(new_volume, hotspot_dist);
    if(new_volume GT 0.1, set(hotspot[%1].volume, get(new_volume))); <!-- 0.1 - minimum volume-->
          <!--if sound can be muted use: set(hotspot[%1].volume, get(new_volume));-->
 </action>

I don't know if this is most efficient way to do this, but i haven't found any other way to have directional sound for videos so that could be useful :)
(probably works for sound on volume too ;)
my example with that code:
http://interaktywnapodroz.pl/promo/

Filip.

2

Wednesday, August 24th 2016, 5:00pm

Can you provide the source code?