<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 4.0//EN" "https://www.web3d.org/specifications/x3d-4.0.dtd">
<X3D profile='Full' version='4.0 xmlns:xsd='http://www.w3.org/2001/XMLSchema-instance' xsd:noNamespaceSchemaLocation =' https://www.web3d.org/specifications/x3d-4.0.xsd '>
<head>
<meta name='titlecontent='SpatialAudioCameraAnimation.x3d'/>
<meta name='descriptioncontent='In the last demo, there are two sound sources in different positions. Through the immersion in the X3D scene the user could attend a rational navigation. Whenever the camera moves in the direction of an existing sound source, the strength of this source increases, while the sound strength of the other (the second one) decreases and vice versa. Through this process, great realism of the scene is achieved, since it emulates the spatial sound in real world.'/>
<meta name='infocontent='This work presents an innovative solution of the spatial sound in X3DOM framework, that based on a combinational methodology. Specifically, we suggested the enrichment of X3DOM with spatial sound features, using both the X3D sound nodes and the structure of Web Audio API.'/>
<meta name='creatorcontent='Efi Lakka, Athanasios Malamos, Dick Puk, Don Brutzman'/>
<meta name='createdcontent='28 October 2020'/>
<meta name='modifiedcontent='5 December 2021'/>
<meta name='referencecontent='CHANGELOG.txt'/>
<meta name=' TODO content=' credit for audio files '/>
<meta name='referencecontent=' https://www.medialab.hmu.gr/minipages/x3domAudio '/>
<meta name='identifiercontent=' https://x3dgraphics.com/examples/X3dForAdvancedModeling/AudioSpatialSound/SpatialAudioCameraAnimation.x3d '/>
<meta name='generatorcontent='X3D-Edit 4.0, https://savage.nps.edu/X3D-Edit'/>
<meta name='licensecontent=' ../license.html'/>
</head>
<!-- -->
<Scene>
<WorldInfo title='SpatialAudioCameraAnimation.x3d'/>
<NavigationInfo id='NAV'/>
<Background
  backUrl=' "images/generic/BK1.png" "https://x3dgraphics.com/examples/X3dForAdvancedModeling/AudioSpatialSound/images/generic/BK1.png" '
  bottomUrl=' "images/generic/DN1.png" "https://x3dgraphics.com/examples/X3dForAdvancedModeling/AudioSpatialSound/images/generic/DN1.png" '
  frontUrl=' "images/generic/FR1.png" "https://x3dgraphics.com/examples/X3dForAdvancedModeling/AudioSpatialSound/images/generic/FR1.png" '
  leftUrl=' "images/generic/LF1.png" "https://x3dgraphics.com/examples/X3dForAdvancedModeling/AudioSpatialSound/images/generic/LF1.png" '
  rightUrl=' "images/generic/RT1.png" "https://x3dgraphics.com/examples/X3dForAdvancedModeling/AudioSpatialSound/images/generic/RT1.png" '
  topUrl=' "images/generic/UP1.png" "https://x3dgraphics.com/examples/X3dForAdvancedModeling/AudioSpatialSound/images/generic/UP1.png" '/>

<!-- ROUTE information for Camera001 node:  [from Camera001-POS-INTERP.value_changed to set_position ] [from Camera001-ROT-INTERP.value_changed to set_orientation ] -->
<Viewpoint DEF='Camera001description='Viewpoint is like camera, prepositioned in locations (and directions) of interest. In this example the camera is the "ears of the user". So, if the trackCurrentView field from ListenerPointSource is TRUE then position and orientation matches the users current vieworientation='1 0 0 -0.523599position='0 2000 3500'/>
<!-- ROUTE information for TIMER node:  [from fraction_changed to Camera001-POS-INTERP.set_fraction ] [from fraction_changed to Camera001-ROT-INTERP.set_fraction ] -->
<TimeSensor DEF='TIMERcycleInterval='33.333332loop='true'/>
<!-- ROUTE information for Camera001-POS-INTERP node:  [from TIMER.fraction_changed to set_fraction ] [from value_changed to Camera001.set_position ] -->
<PositionInterpolator DEF='Camera001-POS-INTERPkey='0 0.25 0.5 0.75 1keyValue='0 2000 3500 0 2000 0 0 2000 -3500 0 2000 0 0 2000 3500'/>
<!-- ROUTE information for Camera001-ROT-INTERP node:  [from TIMER.fraction_changed to set_fraction ] [from value_changed to Camera001.set_orientation ] -->
<OrientationInterpolator DEF='Camera001-ROT-INTERPkey='0 0.25 0.5 0.75 1keyValue='1 0 0 -0.523599 0.999990 0.003554 0.002727 -1.309007 0 -0.965926 -0.258819 -3.141593 0.002282 -0.793351 -0.608760 -3.135645 1 -0.000001 -0 -0.523599'/>
<ROUTE fromNode='TIMERfromField='fraction_changedtoNode='Camera001-POS-INTERPtoField='set_fraction'/>
<ROUTE fromNode='Camera001-POS-INTERPfromField='value_changedtoNode='Camera001toField='set_position'/>
<ROUTE fromNode='TIMERfromField='fraction_changedtoNode='Camera001-ROT-INTERPtoField='set_fraction'/>
<ROUTE fromNode='Camera001-ROT-INTERPfromField='value_changedtoNode='Camera001toField='set_orientation'/>
<Transform DEF='Floortranslation='1.241 0.000 0.358'>
<Shape>
<Appearance DEF='WireColor'>
<Material diffuseColor='0.122 0.114 0.125'/>
</Appearance>
<Box size='2000 1 2000'/>
</Shape>
</Transform>
<Transform DEF='TransformAudio1translation='-933.123474 0 -926.253235'>
<Shape>
<Appearance DEF='WireColor_1'>
<Material diffuseColor='0.690196 0.101961 0.101961'/>
</Appearance>
<Sphere radius='100'/>
</Shape>
<Billboard>
<Transform DEF='violinrotation='1 0 0 -0.5scale='100 100 100translation='0 100 0'>
<Shape>
<Appearance>
<Material ambientIntensity='0.0933diffuseColor='1 1 1shininess='0.51specularColor='0.46 0.46 0.46'/>
</Appearance>
<Text string='"Violin"'>
<FontStyle DEF='ModelFontStylefamily='"Times" "SERIF"style='BOLD'/>
</Text>
</Shape>
</Transform>
</Billboard>
</Transform>
<Transform DEF='TransformAudio2translation='933.475586 0 924.423218'>
<Shape>
<Appearance DEF='WireColor_2'>
<Material diffuseColor='0.105882 0.694118 0.580392'/>
</Appearance>
<Sphere radius='100'/>
</Shape>
<Billboard>
<Transform DEF='saxophonerotation='1 0 0 -0.5scale='100 100 100translation='0 100 0'>
<Shape>
<Appearance>
<Material ambientIntensity='0.0933diffuseColor='1 1 1shininess='0.51specularColor='0.46 0.46 0.46'/>
</Appearance>
<Text string='"Saxophone"'>
<FontStyle USE='ModelFontStyle'/>
</Text>
</Shape>
</Transform>
</Billboard>
</Transform>
<ListenerPointSource id='ListenerPointSourcetrackCurrentView='true'/>
<StreamAudioDestination id='AudioDestinationchannelCountMode='MAXchannelInterpretation='SPEAKERS'>
<SpatialSound DEF='Audio1id='SpatialSound1distanceModel='INVERSE'>
<Gain id='Gain1channelCountMode='MAXchannelInterpretation='SPEAKERS'>
<AudioClip containerField='childrendescription='Violinid='AudioClip1loop='true'
  url=' "sound/violin.mp3" "https://x3dgraphics.com/examples/X3dForAdvancedModeling/AudioSpatialSound/sound/violin.mp3" '/>
</Gain>
</SpatialSound>
<SpatialSound DEF='Audio2id='SpatialSound2distanceModel='INVERSE'>
<Gain id='Gain2channelCountMode='MAXchannelInterpretation='SPEAKERS'>
<AudioClip containerField='childrendescription='Saxophoneid='AudioClip2loop='true'
  url=' "sound/saxophone.mp3" "https://x3dgraphics.com/examples/X3dForAdvancedModeling/AudioSpatialSound/sound/saxophone.mp3" '/>
</Gain>
</SpatialSound>
</StreamAudioDestination>
</Scene>
</X3D>
<!--

Index for DEF nodes : Audio1, Audio2, Camera001, Camera001-POS-INTERP, Camera001-ROT-INTERP, Floor, ModelFontStyle, saxophone, TIMER, TransformAudio1, TransformAudio2, violin, WireColor, WireColor_1, WireColor_2

Index for Viewpoint image : Camera001
-->

<!-- Color key: <X3dNode DEF='idName' field='value'/> matches <XmlElement DEF='idName' attribute='value'/>
(Light blue background: behavior node) (Grey background: inserted documentation) (Magenta background: X3D Extensibility)
-->

<!-- For additional help information about X3D scenes, please see X3D Tooltips, X3D Resources and X3D Scene Authoring Hints. -->