Directional Sound - What is possible?

  • Hi

    Has anyone seen an example of, or written code to enable the playing of a sound 'automatically' as a 360 pano rotates and passes over an area then fades out as the pano moves on. There should be no clicks necessary - the sound just fades in and out as the viewpoint passes over an area. For example, a room with a birdcage - a birdsong plays as it comes into view. Ideally I would like to add 5 or 6 individual sounds to the one pano, in different areas.

    I've mastered the use of a background sound and 'onclick' sounds etc. but this problem has beaten me!

    Any ideas or suggestions would be greatly appreciated.

    Thanks

    Andrew
    Bingley, UK

  • Hi Alexey
    Thanks for your reply. Yes, I've looked at playsound3D (I have the latest versions of plugins etc.) but I can't find any examples of how to correctly apply the coding syntax to the plugin - I'm still learning!

    What I've been able to do so far has all been through de-constructing and adapting other examples. I'm not fluent enough in the XML syntax yet to build it up from nothing.

    I know what I want to do - this is the project I'm currently developing - http://www.ipan360.com/groomingground

    For information, below is the code for the above example. My idea is to have the sounds triggered by the movement of the pano, which I thought 'playsound3D' or 'playsound3Dh' could do. At the moment I just have onclick actions to play the sounds.

    Any advice or suggestions would be most welcome!

    Thanks

    Andrew

    <krpano version="1.18">

    <!-- the skin -->
    <include url="skin/defaultskin.xml" />

    <!-- view settings -->
    <view hlookat="340" vlookat="7" fovtype="MFOV" fov="60" maxpixelzoom="1.0" fovmin="40" fovmax="90" limitview="auto" />

    <plugin name="soundinterface"
    url="plugins/soundinterface.swf"
    alturl="plugins/soundinterface.js"
    preload="true"
    rootpath=""
    volume="1.0"
    mute="false"
    />

    <!-- play sounds -->
    <hotspot name="b1" url="skin/sound.png" ath="22" atv="0" onclick="playsound(s3,sounds/birds.mp3, 1, b1);"/>
    <hotspot name="b2" url="skin/sound.png" ath="348" atv="1" onclick="playsound(s3,sounds/shhh.mp3, 1, b2);"/>
    <hotspot name="b4" url="skin/sound.png" ath="272" atv="8" onclick="playsound(s3,sounds/windchimes.mp3, 1, b4);"/>
    <hotspot name="b5" url="skin/sound.png" ath="73" atv="7" onclick="playsound(s3,sounds/shhh.mp3, 1, b5);"/>


    <hotspot name="video"
    url.flash="plugins/videoplayer.swf"
    url.html5="plugins/videoplayer.js"
    videourl="grooming_ground.mov"
    posterurl="index.tiles/frame.jpg"
    ath="28" atv="-30"
    distorted="true"
    scale="0.75"
    rx="0.0"
    ry="0.0"
    rz="0.0"
    pausedonstart="true"
    loop="false"
    volume="1.0"
    directionalsound="true"
    range="90.0"
    rangefalloff="1.0"
    outofrangevolume="0.0"
    preferredformat=""
    buffertime="0.1"
    ignoremetadata="false"
    onvideoready=""
    onvideoplay=""
    onvideopaused=""
    onvideocomplete=""
    onclick="togglepause();"
    />

    <preview url="index.tiles/preview.jpg" />


    <layer name="menuBar" keep="true" type="container" align="leftbottom" width="100%" height="60" x="0" y="0" bgalpha="0.5"
    bgcolor="0xFFFFFF" onclick="trace(ilovekrpano);" />

    <layer name="skin_logo" url="skin/footer.png" scale="0.75" align="rightbottom"

    x="9" y="9"
    onclick="openurl(http://www.artworkscreative.org.uk,_blank);" />

    <!-- experiment

    <layer name="logos_footer" url="skin/vm_logo.png" scale="0.75" align="rightbottom"

    x="330" y="9"
    onclick="openurl(http://www.via-media.co.uk,_blank);" />

    -->

    <layer name="q1" type="container" url="skin/vm_top_left.png" align="lefttop"
    x="4" y="4" width="146" height="58" bgcolor="0x111111" bgalpha="0.5" onclick="openurl(http://www.via-media.co.uk,_blank);" />


    <image type="CUBE" multires="true" tilesize="512">
    <level tiledimagewidth="5876" tiledimageheight="5876">
    <cube url="index.tiles/mres_%s/l4/%v/l4_%s_%v_%h.jpg" />
    </level>
    <level tiledimagewidth="2938" tiledimageheight="2938">
    <cube url="index.tiles/mres_%s/l3/%v/l3_%s_%v_%h.jpg" />
    </level>
    <level tiledimagewidth="1470" tiledimageheight="1470">
    <cube url="index.tiles/mres_%s/l2/%v/l2_%s_%v_%h.jpg" />
    </level>
    <level tiledimagewidth="736" tiledimageheight="736">
    <cube url="index.tiles/mres_%s/l1/%v/l1_%s_%v_%h.jpg" />
    </level>
    <mobile>
    <cube url="index.tiles/mobile_%s.jpg" />
    </mobile>
    </image>


    </krpano>

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!