<?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 content='SplitChannels.x3d' name='title'/>
    <meta content='This X3D scene includes a simple sound source which can be moved right and left. Depending on the position of the sound source, the user can hear the produced sound from the corresponding output speaker. Accordingly, there is a source that can be passed through a SpatialSound for the spatialization of the input audio. The approach is based on the relative position of the source and the listener, in comparison to the panner.' name='description'/>
    <meta 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='info'/>
    <meta content='Efi Lakka, Athanasios Malamos, Dick Puk, Don Brutzman' name='creator'/>
    <meta content='28 October 2020' name='created'/>
    <meta content='22 August 2025' name='modified'/>
    <meta content='CHANGELOG.txt' name='reference'/>
    <meta content='credit for audio files' name='TODO'/>
    <meta content='http://www.medialab.hmu.gr/minipages/x3domAudio' name='reference'/>
    <meta content='https://medialab.hmu.gr/minipages/x3domAudio/splitChannels.xhtml' name='reference'/>
    <meta content='https://www.web3d.org/x3d/content/examples/X3dForAdvancedModeling/AudioSpatialSound/SplitChannels.x3d' name='identifier'/>
    <meta content='X3D-Edit 4.0, https://www.web3d.org/x3d/tools/X3D-Edit' name='generator'/>
    <meta content='../license.html' name='license'/>
  </head>
  <Scene>
    <WorldInfo title='SplitChannels.x3d'/>
    <NavigationInfo id='NAV' type='NONE'/>
    <Background skyColor='0.200 0.200 0.210'/>
    <Viewpoint orientation='1 0 0 -0.5' position='0.0 500.0 600.0' retainUserOffsets='true'/>
    <Transform DEF='PowerR' translation='100 400 400'>
      <Transform id='pR' rotation='1 0 0 -0.5' translation='0 40 0'>
        <Shape>
          <Appearance DEF='audio_emit'>
            <Material diffuseColor='0 1 0' emissiveColor='0.8 0.8 0.8' specularColor='0.01 0.01 0.01'/>
          </Appearance>
          <Box size='10 80 0.01'/>
        </Shape>
      </Transform>
      <Transform rotation='1 0 0 -0.5' translation='-2.7 37 0'>
        <Shape>
          <Appearance DEF='audio_emit2'>
            <Material diffuseColor='0 1 0' emissiveColor='0.8 0.8 0.8' specularColor='0.01 0.01 0.01'/>
            <ImageTexture url='"images/line.png" "https://www.web3d.org/x3d/content/examples/X3dForAdvancedModeling/AudioSpatialSound/images/line.png"'/>
          </Appearance>
          <Box size='25 83 0.01'/>
        </Shape>
      </Transform>
      <Transform DEF='volumeRight' rotation='1 0 0 -0.5' scale='10 10 10' translation='0 -10 0'>
        <Shape>
          <Appearance>
            <Material ambientIntensity='0.0933' diffuseColor='0.345 0.345 0.882' shininess='0.51' specularColor='0.46 0.46 0.46'/>
          </Appearance>
          <Text string='Right Channel Volume'>
            <FontStyle DEF='VolumeFontStyle' family='"Times" "SERIF"' style='BOLD'/>
          </Text>
        </Shape>
      </Transform>
    </Transform>
    <Transform DEF='PowerL' translation='-100 400 400'>
      <Transform id='pL' rotation='1 0 0 -0.5' translation='0 40 0'>
        <Shape>
          <Appearance DEF='audio_emit3'>
            <Material diffuseColor='0 1 0' emissiveColor='0.8 0.8 0.8' specularColor='0.01 0.01 0.01'/>
          </Appearance>
          <Box size='10 80 0.01'/>
        </Shape>
      </Transform>
      <Transform rotation='1 0 0 -0.5' translation='13.2 37 0'>
        <Shape>
          <Appearance DEF='audio_emit4'>
            <Material diffuseColor='0 1 0' emissiveColor='0.8 0.8 0.8' specularColor='0.01 0.01 0.01'/>
            <ImageTexture url='"images/line.png" "https://www.web3d.org/x3d/content/examples/X3dForAdvancedModeling/AudioSpatialSound/images/line.png"'/>
          </Appearance>
          <Box size='25 83 0.01'/>
        </Shape>
      </Transform>
      <Transform DEF='volumeLeft' rotation='1 0 0 -0.5' scale='10 10 10' translation='0 -10 0'>
        <Shape>
          <Appearance>
            <Material ambientIntensity='0.0933' diffuseColor='0.345 0.345 0.882' shininess='0.51' specularColor='0.46 0.46 0.46'/>
          </Appearance>
          <Text string='Left Channel Volume'>
            <FontStyle USE='VolumeFontStyle'/>
          </Text>
        </Shape>
      </Transform>
    </Transform>
    <Transform>
      <Shape>
        <Appearance DEF='floor'>
          <Material diffuseColor='0.1 0.1 0.1' shininess='0.8' specularColor='0.5 0.6 0.7'/>
        </Appearance>
        <Box size='1500 10 500'/>
      </Shape>
    </Transform>
    <ListenerPointSource id='ListenerPointSource' trackCurrentView='true'/>
    <StreamAudioDestination id='AudioDestination'>
      <Gain id='Gain3'>
        <ChannelMerger id='ChannelMerger'>
          <ChannelSelector id='ChannelSelector0'>
            <Gain USE='ChannelSplitter'/>
          </ChannelSelector>
          <ChannelSelector channelSelection='1' id='ChannelSelector1'>
            <Gain USE='ChannelSplitter'/>
          </ChannelSelector>
        </ChannelMerger>
      </Gain>
    </StreamAudioDestination>
    <ChannelSplitter DEF='ChannelSplitter' channelCountMode='EXPLICIT'>
      <AudioClip containerField='children' description='Violin' enabled='false' gain='1' 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"'/>
    </ChannelSplitter>
    <Transform DEF='Audio3' rotation='1 0 0 -0.5' translation='0 100 0'>
      <Shape>
        <Appearance DEF='audio_emit5'>
          <Material diffuseColor='0.3 1 0.3' emissiveColor='0.8 0.8 0.8' specularColor='0.01 0.01 0.01'/>
          <ImageTexture url='"images/loudspeaker.png" "https://www.web3d.org/x3d/content/examples/X3dForAdvancedModeling/AudioSpatialSound/images/loudspeaker.png"'/>
        </Appearance>
        <Box size='100 100 0.001'/>
      </Shape>
    </Transform>
  </Scene>
</X3D>