You are not logged in.

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?