{ "X3D": {
    "encoding":"UTF-8",
    "@profile":"Full",
    "@version":"4.0",
    "@xsd:noNamespaceSchemaLocation":"https://www.web3d.org/specifications/x3d-4.0.xsd",
    "JSON schema":"https://www.web3d.org/specifications/x3d-4.0-JSONSchema.autogenerated.json",
    "head": {
        "meta": [
          {
            "@name":"title",
            "@content":"SpatialAudioCameraAnimation.x3d"
          },
          {
            "@name":"description",
            "@content":"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."
          },
          {
            "@name":"info",
            "@content":"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."
          },
          {
            "@name":"creator",
            "@content":"Efi Lakka, Athanasios Malamos, Dick Puk, Don Brutzman"
          },
          {
            "@name":"created",
            "@content":"28 October 2020"
          },
          {
            "@name":"modified",
            "@content":"22 August 2025"
          },
          {
            "@name":"reference",
            "@content":"CHANGELOG.txt"
          },
          {
            "@name":"TODO",
            "@content":"credit for audio files"
          },
          {
            "@name":"reference",
            "@content":"https://www.medialab.hmu.gr/minipages/x3domAudio"
          },
          {
            "@name":"reference",
            "@content":"https://medialab.hmu.gr/minipages/x3domAudio/SpatialAudioCameraAnimation.xhtml"
          },
          {
            "@name":"identifier",
            "@content":"https://www.web3d.org/x3d/content/examples/X3dForAdvancedModeling/AudioSpatialSound/SpatialAudioCameraAnimation.x3d"
          },
          {
            "@name":"generator",
            "@content":"X3D-Edit 4.0, https://www.web3d.org/x3d/tools/X3D-Edit"
          },
          {
            "@name":"license",
            "@content":"../license.html"
          },
          {
            "@name":"translated",
            "@content":"16 April 2026"
          },
          {
            "@name":"generator",
            "@content":"X3dToJson.xslt, https://www.web3d.org/x3d/stylesheets/X3dToJson.html"
          },
          {
            "@name":"reference",
            "@content":"X3D JSON encoding: https://www.web3d.org/wiki/index.php/X3D_JSON_Encoding"
          }
        ]
    },
    "Scene": {
        "-children":[
          { "WorldInfo":
            {
              "@title":"SpatialAudioCameraAnimation.x3d"
            }
          },
          { "NavigationInfo":
            {
            }
          },
          { "Background":
            {
              "@backUrl":["images/generic/BK1.png","https://www.web3d.org/x3d/content/examples/X3dForAdvancedModeling/AudioSpatialSound/images/generic/BK1.png"],
              "@bottomUrl":["images/generic/DN1.png","https://www.web3d.org/x3d/content/examples/X3dForAdvancedModeling/AudioSpatialSound/images/generic/DN1.png"],
              "@frontUrl":["images/generic/FR1.png","https://www.web3d.org/x3d/content/examples/X3dForAdvancedModeling/AudioSpatialSound/images/generic/FR1.png"],
              "@leftUrl":["images/generic/LF1.png","https://www.web3d.org/x3d/content/examples/X3dForAdvancedModeling/AudioSpatialSound/images/generic/LF1.png"],
              "@rightUrl":["images/generic/RT1.png","https://www.web3d.org/x3d/content/examples/X3dForAdvancedModeling/AudioSpatialSound/images/generic/RT1.png"],
              "@topUrl":["images/generic/UP1.png","https://www.web3d.org/x3d/content/examples/X3dForAdvancedModeling/AudioSpatialSound/images/generic/UP1.png"]
            }
          },
          { "Viewpoint":
            {
              "@DEF":"Camera001",
              "@description":"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 view",
              "@orientation":[1,0,0,-0.523599],
              "@position":[0,2000,3500]
            }
          },
          { "TimeSensor":
            {
              "@DEF":"TIMER",
              "@cycleInterval":33.333332,
              "@loop":true
            }
          },
          { "PositionInterpolator":
            {
              "@DEF":"Camera001-POS-INTERP",
              "@key":[0,0.25,0.5,0.75,1],
              "@keyValue":[0,2000,3500,0,2000,0,0,2000,-3500,0,2000,0,0,2000,3500]
            }
          },
          { "OrientationInterpolator":
            {
              "@DEF":"Camera001-ROT-INTERP",
              "@key":[0,0.25,0.5,0.75,1],
              "@keyValue":[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":
            {
              "@fromField":"fraction_changed",
              "@fromNode":"TIMER",
              "@toField":"set_fraction",
              "@toNode":"Camera001-POS-INTERP"
            }
          },
          { "ROUTE":
            {
              "@fromField":"value_changed",
              "@fromNode":"Camera001-POS-INTERP",
              "@toField":"set_position",
              "@toNode":"Camera001"
            }
          },
          { "ROUTE":
            {
              "@fromField":"fraction_changed",
              "@fromNode":"TIMER",
              "@toField":"set_fraction",
              "@toNode":"Camera001-ROT-INTERP"
            }
          },
          { "ROUTE":
            {
              "@fromField":"value_changed",
              "@fromNode":"Camera001-ROT-INTERP",
              "@toField":"set_orientation",
              "@toNode":"Camera001"
            }
          },
          { "Transform":
            {
              "@DEF":"Floor",
              "@translation":[1.241,0.000,0.358],
              "-children":[
                { "Shape":
                  {
                    "-appearance":
                      { "Appearance":
                        {
                          "@DEF":"WireColor",
                          "-material":
                            { "Material":
                              {
                                "@diffuseColor":[0.122,0.114,0.125]
                              }
                            }
                        }
                      },
                    "-geometry":
                      { "Box":
                        {
                          "@size":[2000,1,2000]
                        }
                      }
                  }
                }
              ]
            }
          },
          { "Transform":
            {
              "@DEF":"TransformAudio1",
              "@translation":[-933.123474,0,-926.253235],
              "-children":[
                { "Shape":
                  {
                    "-appearance":
                      { "Appearance":
                        {
                          "@DEF":"WireColor_1",
                          "-material":
                            { "Material":
                              {
                                "@diffuseColor":[0.690196,0.101961,0.101961]
                              }
                            }
                        }
                      },
                    "-geometry":
                      { "Sphere":
                        {
                          "@radius":100
                        }
                      }
                  }
                },
                { "Billboard":
                  {
                    "-children":[
                      { "Transform":
                        {
                          "@DEF":"violin",
                          "@rotation":[1,0,0,-0.5],
                          "@scale":[100,100,100],
                          "@translation":[0,100,0],
                          "-children":[
                            { "Shape":
                              {
                                "-appearance":
                                  { "Appearance":
                                    {
                                      "-material":
                                        { "Material":
                                          {
                                            "@ambientIntensity":0.0933,
                                            "@diffuseColor":[1,1,1],
                                            "@shininess":0.51,
                                            "@specularColor":[0.46,0.46,0.46]
                                          }
                                        }
                                    }
                                  },
                                "-geometry":
                                  { "Text":
                                    {
                                      "@string":["Violin"],
                                      "-fontStyle":
                                        { "FontStyle":
                                          {
                                            "@DEF":"ModelFontStyle",
                                            "@family":["Times","SERIF"],
                                            "@style":"BOLD"
                                          }
                                        }
                                    }
                                  }
                              }
                            }
                          ]
                        }
                      }
                    ]
                  }
                }
              ]
            }
          },
          { "Transform":
            {
              "@DEF":"TransformAudio2",
              "@translation":[933.475586,0,924.423218],
              "-children":[
                { "Shape":
                  {
                    "-appearance":
                      { "Appearance":
                        {
                          "@DEF":"WireColor_2",
                          "-material":
                            { "Material":
                              {
                                "@diffuseColor":[0.105882,0.694118,0.580392]
                              }
                            }
                        }
                      },
                    "-geometry":
                      { "Sphere":
                        {
                          "@radius":100
                        }
                      }
                  }
                },
                { "Billboard":
                  {
                    "-children":[
                      { "Transform":
                        {
                          "@DEF":"saxophone",
                          "@rotation":[1,0,0,-0.5],
                          "@scale":[100,100,100],
                          "@translation":[0,100,0],
                          "-children":[
                            { "Shape":
                              {
                                "-appearance":
                                  { "Appearance":
                                    {
                                      "-material":
                                        { "Material":
                                          {
                                            "@ambientIntensity":0.0933,
                                            "@diffuseColor":[1,1,1],
                                            "@shininess":0.51,
                                            "@specularColor":[0.46,0.46,0.46]
                                          }
                                        }
                                    }
                                  },
                                "-geometry":
                                  { "Text":
                                    {
                                      "@string":["Saxophone"],
                                      "-fontStyle":
                                        { "FontStyle":
                                          {
                                            "@USE":"ModelFontStyle"
                                          }
                                        }
                                    }
                                  }
                              }
                            }
                          ]
                        }
                      }
                    ]
                  }
                }
              ]
            }
          },
          { "ListenerPointSource":
            {
              "@trackCurrentView":true
            }
          },
          { "StreamAudioDestination":
            {
              "-children":[
                { "SpatialSound":
                  {
                    "@DEF":"Audio1",
                    "-children":[
                      { "Gain":
                        {
                          "-children":[
                            { "AudioClip":
                              {
                                "@description":"Violin",
                                "@enabled":false,
                                "@url":["sound/violin.ogg","https://www.web3d.org/x3d/content/examples/X3dForAdvancedModeling/AudioSpatialSound/sound/violin.ogg","sound/violin.mp3","https://www.web3d.org/x3d/content/examples/X3dForAdvancedModeling/AudioSpatialSound/sound/violin.mp3","sound/violin.wav","https://www.web3d.org/x3d/content/examples/X3dForAdvancedModeling/AudioSpatialSound/sound/violin.wav"]
                              }
                            }
                          ]
                        }
                      }
                    ]
                  }
                },
                { "SpatialSound":
                  {
                    "@DEF":"Audio2",
                    "-children":[
                      { "Gain":
                        {
                          "-children":[
                            { "AudioClip":
                              {
                                "@description":"Saxophone",
                                "@loop":true,
                                "@url":["sound/saxophone.mp3","https://www.web3d.org/x3d/content/examples/X3dForAdvancedModeling/AudioSpatialSound/sound/saxophone.mp3"]
                              }
                            }
                          ]
                        }
                      }
                    ]
                  }
                }
              ]
            }
          }
        ]
    }
  }
}