Interface SpatialSound

All Superinterfaces:
X3DChildNode, X3DNode, X3DSoundNode
All Known Implementing Classes:
SpatialSound

public interface SpatialSound extends X3DSoundNode
The SpatialSound node controls the 3D spatialization of sound playback by a child AudioClip or MovieTexture node.

Warning: this is an abstract interface that cannot be instantiated as a concrete object. Java programmers typically only need to use concrete objects provided by the org.web3d.x3d.jsail classes. SpatialSound node tooltip: [X3DSoundNode] The SpatialSound node controls the 3D spatialization of sound playback by a child AudioClip or MovieTexture node. Sound intensity includes stereo support, varying according to user location and view direction in the scene.
Package hint: This interface is defined by the X3D Java Language Binding Specification for the Scene Authoring Interface (SAI).
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addChildren(X3DNode[] newValue)
    Add array of children nodes to array of existing nodes (if any).
    Provide array of org.web3d.x3d.sai.Core.X3DNode results (using an array consisting of properly typed nodes or ProtoInstances) with acceptable node types limited to Analyser|AudioClip|AudioDestination|BiquadFilter|BufferAudioSource|ChannelMerger|ChannelSelector|ChannelSplitter|Convolver|Delay|DynamicsCompressor|Gain|ListenerPointSource|MicrophoneSource|MovieTexture|OscillatorSource|Sound|SpatialSound|StreamAudioDestination|StreamAudioSource|WaveShaper, from inputOutput MFNode field children.
    float
    Provide float value unit axis, angle (in radians) within allowed range of [0,6.2832] from inputOutput SFFloat field named coneInnerAngle.
    float
    Provide float value unit axis, angle (in radians) within allowed range of [0,6.2832] from inputOutput SFFloat field named coneOuterAngle.
    float
    Provide float value from inputOutput SFFloat field named coneOuterGain.
    Provide String value from inputOutput SFString field named description.
    float[]
    Provide array of 3-tuple float results from inputOutput SFVec3f field named direction.
    Provide String enumeration value (baseType SFString) ["LINEAR" | "INVERSE" | "EXPONENTIAL"] from inputOutput SFString field named distanceModel.
    boolean
    Provide boolean value from inputOutput SFBool field named dopplerEnabled.
    boolean
    Provide boolean value from inputOutput SFBool field named enabled.
    boolean
    Provide boolean value from inputOutput SFBool field named enableHRTF.
    float
    Provide float value from inputOutput SFFloat field named gain.
    float
    Provide float value within allowed range of [0,1] from inputOutput SFFloat field named intensity.
    float[]
    Provide array of 3-tuple float results from inputOutput SFVec3f field named location.
    float
    Provide float value within allowed range of [0,infinity) from inputOutput SFFloat field named maxDistance.
    Provide org.web3d.x3d.sai.Core.X3DMetadataObject instance (using a properly typed node) from inputOutput SFNode field metadata.
    float
    Provide float value within allowed range of [0,1] from inputOutput SFFloat field named priority.
    float
    Provide float value within allowed range of [0,infinity) from inputOutput SFFloat field named referenceDistance.
    float
    Provide float value within allowed range of [0,infinity) from inputOutput SFFloat field named rolloffFactor.
    boolean
    Provide boolean value from initializeOnly SFBool field named spatialize.
    void
    setChildren(X3DNode newValue)
    Set single children node, replacing prior array of existing nodes (if any).
    setChildren(X3DNode[] newValue)
    Accessor method to assign org.web3d.x3d.sai.Core.X3DNode array (using an array consisting of properly typed nodes or ProtoInstances) to inputOutput MFNode field children.
    setConeInnerAngle(float newValue)
    Accessor method to assign float value unit axis, angle (in radians) to inputOutput SFFloat field named coneInnerAngle.
    setConeOuterAngle(float newValue)
    Accessor method to assign float value unit axis, angle (in radians) to inputOutput SFFloat field named coneOuterAngle.
    setConeOuterGain(float newValue)
    Accessor method to assign float value to inputOutput SFFloat field named coneOuterGain.
    Accessor method to assign String value to inputOutput SFString field named description.
    setDirection(float[] newValue)
    Accessor method to assign 3-tuple float array to inputOutput SFVec3f field named direction.
    Accessor method to assign String enumeration value ("LINEAR" | "INVERSE" | "EXPONENTIAL") to inputOutput SFString field named distanceModel.
    setDopplerEnabled(boolean newValue)
    Accessor method to assign boolean value to inputOutput SFBool field named dopplerEnabled.
    setEnabled(boolean newValue)
    Accessor method to assign boolean value to inputOutput SFBool field named enabled.
    setEnableHRTF(boolean newValue)
    Accessor method to assign boolean value to inputOutput SFBool field named enableHRTF.
    setGain(float newValue)
    Accessor method to assign float value to inputOutput SFFloat field named gain.
    setIntensity(float newValue)
    Accessor method to assign float value to inputOutput SFFloat field named intensity.
    setLocation(float[] newValue)
    Accessor method to assign 3-tuple float array to inputOutput SFVec3f field named location.
    setMaxDistance(float newValue)
    Accessor method to assign float value to inputOutput SFFloat field named maxDistance.
    Accessor method to assign org.web3d.x3d.sai.Core.X3DMetadataObject instance (using a properly typed node) to inputOutput SFNode field metadata.
    setPriority(float newValue)
    Accessor method to assign float value to inputOutput SFFloat field named priority.
    setReferenceDistance(float newValue)
    Accessor method to assign float value to inputOutput SFFloat field named referenceDistance.
    setRolloffFactor(float newValue)
    Accessor method to assign float value to inputOutput SFFloat field named rolloffFactor.
    setSpatialize(boolean newValue)
    Accessor method to assign boolean value to initializeOnly SFBool field named spatialize.
  • Method Details

    • getChildren

      X3DNode[] getChildren()
      Provide array of org.web3d.x3d.sai.Core.X3DNode results (using an array consisting of properly typed nodes or ProtoInstances) with acceptable node types limited to Analyser|AudioClip|AudioDestination|BiquadFilter|BufferAudioSource|ChannelMerger|ChannelSelector|ChannelSplitter|Convolver|Delay|DynamicsCompressor|Gain|ListenerPointSource|MicrophoneSource|MovieTexture|OscillatorSource|Sound|SpatialSound|StreamAudioDestination|StreamAudioSource|WaveShaper, from inputOutput MFNode field children.

      Tooltip: [X3DSoundChannelNode|X3DSoundProcessingNode|X3DSoundSourceNode] The children field specifies audio-graph sound sources providing input signals for this node. If multiple input signals are provided by the inputs children field, all channels are mixed together and merged prior to presentation.
      • Warning: contained AudioClip or MovieTexture nodes must have containerField='children' to override otherwise-incorrect defaults.
      • Hint: can be original (DEF) or referenced (USE) nodes.


      Warning: according to X3D Unified Object Model (X3DUOM), acceptable node types are limited to Analyser|AudioClip|AudioDestination|BiquadFilter|BufferAudioSource|ChannelMerger|ChannelSelector|ChannelSplitter|Convolver|Delay|DynamicsCompressor|Gain|ListenerPointSource|MicrophoneSource|MovieTexture|OscillatorSource|Sound|SpatialSound|StreamAudioDestination|StreamAudioSource|WaveShaper.
      Returns:
      value of children field
      See Also:
    • setChildren

      SpatialSound setChildren(X3DNode[] newValue)
      Accessor method to assign org.web3d.x3d.sai.Core.X3DNode array (using an array consisting of properly typed nodes or ProtoInstances) to inputOutput MFNode field children.

      Tooltip: [X3DSoundChannelNode|X3DSoundProcessingNode|X3DSoundSourceNode] The children field specifies audio-graph sound sources providing input signals for this node. If multiple input signals are provided by the inputs children field, all channels are mixed together and merged prior to presentation.
      • Warning: contained AudioClip or MovieTexture nodes must have containerField='children' to override otherwise-incorrect defaults.
      • Hint: can be original (DEF) or referenced (USE) nodes.


      Note: according to X3D Unified Object Model (X3DUOM), acceptable node types are limited to Analyser|AudioClip|AudioDestination|BiquadFilter|BufferAudioSource|ChannelMerger|ChannelSelector|ChannelSplitter|Convolver|Delay|DynamicsCompressor|Gain|ListenerPointSource|MicrophoneSource|MovieTexture|OscillatorSource|Sound|SpatialSound|StreamAudioDestination|StreamAudioSource|WaveShaper.
      Parameters:
      newValue - is new value for the children field.
      Returns:
      SpatialSound - namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).
    • addChildren

      void addChildren(X3DNode[] newValue)
      Add array of children nodes to array of existing nodes (if any).

      Note: according to X3D Unified Object Model (X3DUOM), acceptable node types are limited to Analyser|AudioClip|AudioDestination|BiquadFilter|BufferAudioSource|ChannelMerger|ChannelSelector|ChannelSplitter|Convolver|Delay|DynamicsCompressor|Gain|ListenerPointSource|MicrophoneSource|MovieTexture|OscillatorSource|Sound|SpatialSound|StreamAudioDestination|StreamAudioSource|WaveShaper.
      Parameters:
      newValue - is new value array to be appended the children field.
    • setChildren

      void setChildren(X3DNode newValue)
      Set single children node, replacing prior array of existing nodes (if any).
      Parameters:
      newValue - is new node for the children field
    • getConeInnerAngle

      float getConeInnerAngle()
      Provide float value unit axis, angle (in radians) within allowed range of [0,6.2832] from inputOutput SFFloat field named coneInnerAngle.

      Tooltip: [0,2pi] coneInnerAngle is centered along direction and defines the inner conical volume, inside of which no source gain reduction occurs.
      Returns:
      value of coneInnerAngle field
    • setConeInnerAngle

      SpatialSound setConeInnerAngle(float newValue)
      Accessor method to assign float value unit axis, angle (in radians) to inputOutput SFFloat field named coneInnerAngle.

      Tooltip: [0,2pi] coneInnerAngle is centered along direction and defines the inner conical volume, inside of which no source gain reduction occurs.
      Parameters:
      newValue - is new value for the coneInnerAngle field.
      Returns:
      SpatialSound - namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).
    • getConeOuterAngle

      float getConeOuterAngle()
      Provide float value unit axis, angle (in radians) within allowed range of [0,6.2832] from inputOutput SFFloat field named coneOuterAngle.

      Tooltip: [0,2pi] coneOuterAngle is centered along direction and defines an outer conical volume, within which the sound gain decreases linearly from full gain to coneOuterGain. Outside of coneOuterAngle, gain equals coneOuterGain.
      Returns:
      value of coneOuterAngle field
    • setConeOuterAngle

      SpatialSound setConeOuterAngle(float newValue)
      Accessor method to assign float value unit axis, angle (in radians) to inputOutput SFFloat field named coneOuterAngle.

      Tooltip: [0,2pi] coneOuterAngle is centered along direction and defines an outer conical volume, within which the sound gain decreases linearly from full gain to coneOuterGain. Outside of coneOuterAngle, gain equals coneOuterGain.
      Parameters:
      newValue - is new value for the coneOuterAngle field.
      Returns:
      SpatialSound - namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).
    • getConeOuterGain

      float getConeOuterGain()
      Provide float value from inputOutput SFFloat field named coneOuterGain.

      Tooltip: (-infinity,+infinity) coneOuterGain is minimum gain value found outside coneOuterAngle. *
      Returns:
      value of coneOuterGain field
    • setConeOuterGain

      SpatialSound setConeOuterGain(float newValue)
      Accessor method to assign float value to inputOutput SFFloat field named coneOuterGain.

      Tooltip: (-infinity,+infinity) coneOuterGain is minimum gain value found outside coneOuterAngle. *
      Parameters:
      newValue - is new value for the coneOuterGain field.
      Returns:
      SpatialSound - namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).
    • getDescription

      String getDescription()
      Provide String value from inputOutput SFString field named description.

      Tooltip: Author-provided prose that describes intended purpose of the url asset.
      • Hint: many XML tools substitute XML character references for special characters automatically if needed within an attribute value (such as & for & ampersand character, or " for " quotation-mark character).
      Specified by:
      getDescription in interface X3DSoundNode
      Returns:
      value of description field
    • setDescription

      SpatialSound setDescription(String newValue)
      Accessor method to assign String value to inputOutput SFString field named description.

      Tooltip: Author-provided prose that describes intended purpose of the url asset.
      • Hint: many XML tools substitute XML character references for special characters automatically if needed within an attribute value (such as & for & ampersand character, or " for " quotation-mark character).
      Specified by:
      setDescription in interface X3DSoundNode
      Parameters:
      newValue - is new value for the description field.
      Returns:
      SpatialSound - namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).
    • getDirection

      float[] getDirection()
      Provide array of 3-tuple float results from inputOutput SFVec3f field named direction.

      Tooltip: direction of sound axis, relative to local coordinate system. *
      Returns:
      value of direction field
    • setDirection

      SpatialSound setDirection(float[] newValue)
      Accessor method to assign 3-tuple float array to inputOutput SFVec3f field named direction.

      Tooltip: direction of sound axis, relative to local coordinate system. *
      Parameters:
      newValue - is new value for the direction field.
      Returns:
      SpatialSound - namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).
    • getDistanceModel

      String getDistanceModel()
      Provide String enumeration value (baseType SFString) ["LINEAR" | "INVERSE" | "EXPONENTIAL"] from inputOutput SFString field named distanceModel.

      Tooltip: distanceModel determines how field specifies which algorithm to use for sound attenuation, corresponding to distance between an audio source and a listener, as it moves away from the listener.
      Returns:
      value of distanceModel field
    • setDistanceModel

      SpatialSound setDistanceModel(String newValue)
      Accessor method to assign String enumeration value ("LINEAR" | "INVERSE" | "EXPONENTIAL") to inputOutput SFString field named distanceModel.

      Tooltip: distanceModel determines how field specifies which algorithm to use for sound attenuation, corresponding to distance between an audio source and a listener, as it moves away from the listener.
      Parameters:
      newValue - is new value for the distanceModel field.
      Returns:
      SpatialSound - namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).
    • getDopplerEnabled

      boolean getDopplerEnabled()
      Provide boolean value from inputOutput SFBool field named dopplerEnabled.

      Tooltip: dopplerEnabled enables/disables whether real-time Doppler effects (due to relation motion between sources and listeners) are computed by browser between virtual sound sources and active listening locations, then applied to received frequency at active listening locations.
      Returns:
      value of dopplerEnabled field
    • setDopplerEnabled

      SpatialSound setDopplerEnabled(boolean newValue)
      Accessor method to assign boolean value to inputOutput SFBool field named dopplerEnabled.

      Tooltip: dopplerEnabled enables/disables whether real-time Doppler effects (due to relation motion between sources and listeners) are computed by browser between virtual sound sources and active listening locations, then applied to received frequency at active listening locations.
      Parameters:
      newValue - is new value for the dopplerEnabled field.
      Returns:
      SpatialSound - namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).
    • getEnabled

      boolean getEnabled()
      Provide boolean value from inputOutput SFBool field named enabled.

      Tooltip: Enables/disables node operation. *
      Specified by:
      getEnabled in interface X3DSoundNode
      Returns:
      value of enabled field
    • setEnabled

      SpatialSound setEnabled(boolean newValue)
      Accessor method to assign boolean value to inputOutput SFBool field named enabled.

      Tooltip: Enables/disables node operation. *
      Specified by:
      setEnabled in interface X3DSoundNode
      Parameters:
      newValue - is new value for the enabled field.
      Returns:
      SpatialSound - namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).
    • getEnableHRTF

      boolean getEnableHRTF()
      Provide boolean value from inputOutput SFBool field named enableHRTF.

      Tooltip: enableHRTF enables/disables Head Related Transfer Function (HRTF) auralization, if available. SpatialSound enabledHRTF=true corresponds to panningModelType HRTF, enabledHRTF=false corresponds to panningModelType equalpower.
      Returns:
      value of enableHRTF field
    • setEnableHRTF

      SpatialSound setEnableHRTF(boolean newValue)
      Accessor method to assign boolean value to inputOutput SFBool field named enableHRTF.

      Tooltip: enableHRTF enables/disables Head Related Transfer Function (HRTF) auralization, if available. SpatialSound enabledHRTF=true corresponds to panningModelType HRTF, enabledHRTF=false corresponds to panningModelType equalpower.
      Parameters:
      newValue - is new value for the enableHRTF field.
      Returns:
      SpatialSound - namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).
    • getGain

      float getGain()
      Provide float value from inputOutput SFFloat field named gain.

      Tooltip: (-infinity,+infinity) The gain field is a factor that represents the amount of linear amplification to apply to the output of the node.
      • Warning: Decibel values shall not be used.
      • Hint: Negative gain factors negate the input signal.
      Returns:
      value of gain field
    • setGain

      SpatialSound setGain(float newValue)
      Accessor method to assign float value to inputOutput SFFloat field named gain.

      Tooltip: (-infinity,+infinity) The gain field is a factor that represents the amount of linear amplification to apply to the output of the node.
      • Warning: Decibel values shall not be used.
      • Hint: Negative gain factors negate the input signal.
      Parameters:
      newValue - is new value for the gain field.
      Returns:
      SpatialSound - namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).
    • getIntensity

      float getIntensity()
      Provide float value within allowed range of [0,1] from inputOutput SFFloat field named intensity.

      Tooltip: Factor [0,1] adjusting loudness (decibels) of emitted sound. *
      Returns:
      value of intensity field
    • setIntensity

      SpatialSound setIntensity(float newValue)
      Accessor method to assign float value to inputOutput SFFloat field named intensity.

      Tooltip: Factor [0,1] adjusting loudness (decibels) of emitted sound. *
      Parameters:
      newValue - is new value for the intensity field.
      Returns:
      SpatialSound - namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).
    • getLocation

      float[] getLocation()
      Provide array of 3-tuple float results from inputOutput SFVec3f field named location.

      Tooltip: [0,+infinity) Position of sound ellipsoid center, relative to local coordinate system.
      • Hint: improve audibility by setting location='0 1.6 0' so that center height of sound ellipsoid matches typical NavigationInfo avatarSize height.
      Returns:
      value of location field
    • setLocation

      SpatialSound setLocation(float[] newValue)
      Accessor method to assign 3-tuple float array to inputOutput SFVec3f field named location.

      Tooltip: [0,+infinity) Position of sound ellipsoid center, relative to local coordinate system.
      • Hint: improve audibility by setting location='0 1.6 0' so that center height of sound ellipsoid matches typical NavigationInfo avatarSize height.
      Parameters:
      newValue - is new value for the location field.
      Returns:
      SpatialSound - namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).
    • getMaxDistance

      float getMaxDistance()
      Provide float value within allowed range of [0,infinity) from inputOutput SFFloat field named maxDistance.

      Tooltip: [0,+infinity) maxDistance is the maximum distance where sound is renderable between source and listener, after which no reduction in sound volume occurs. *
      Returns:
      value of maxDistance field
    • setMaxDistance

      SpatialSound setMaxDistance(float newValue)
      Accessor method to assign float value to inputOutput SFFloat field named maxDistance.

      Tooltip: [0,+infinity) maxDistance is the maximum distance where sound is renderable between source and listener, after which no reduction in sound volume occurs. *
      Parameters:
      newValue - is new value for the maxDistance field.
      Returns:
      SpatialSound - namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).
    • getMetadata

      X3DMetadataObject getMetadata()
      Provide org.web3d.x3d.sai.Core.X3DMetadataObject instance (using a properly typed node) from inputOutput SFNode field metadata.

      Tooltip: [X3DMetadataObject] Information about this node can be contained in a MetadataBoolean, MetadataDouble, MetadataFloat, MetadataInteger, MetadataString or MetadataSet node.
      Specified by:
      getMetadata in interface X3DChildNode
      Specified by:
      getMetadata in interface X3DNode
      Specified by:
      getMetadata in interface X3DSoundNode
      Returns:
      value of metadata field
      See Also:
    • setMetadata

      SpatialSound setMetadata(X3DMetadataObject newValue)
      Accessor method to assign org.web3d.x3d.sai.Core.X3DMetadataObject instance (using a properly typed node) to inputOutput SFNode field metadata.

      Tooltip: [X3DMetadataObject] Information about this node can be contained in a MetadataBoolean, MetadataDouble, MetadataFloat, MetadataInteger, MetadataString or MetadataSet node.
      Specified by:
      setMetadata in interface X3DChildNode
      Specified by:
      setMetadata in interface X3DNode
      Specified by:
      setMetadata in interface X3DSoundNode
      Parameters:
      newValue - is new value for the metadata field.
      Returns:
      SpatialSound - namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).
      See Also:
    • getPriority

      float getPriority()
      Provide float value within allowed range of [0,1] from inputOutput SFFloat field named priority.

      Tooltip: Player hint [0,1] if needed to choose which sounds to play. *
      Returns:
      value of priority field
    • setPriority

      SpatialSound setPriority(float newValue)
      Accessor method to assign float value to inputOutput SFFloat field named priority.

      Tooltip: Player hint [0,1] if needed to choose which sounds to play. *
      Parameters:
      newValue - is new value for the priority field.
      Returns:
      SpatialSound - namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).
    • getReferenceDistance

      float getReferenceDistance()
      Provide float value within allowed range of [0,infinity) from inputOutput SFFloat field named referenceDistance.

      Tooltip: [0,+infinity) referenceDistance for reducing volume as source moves further from the listener. For distances less than this value, volume is not reduced.
      Returns:
      value of referenceDistance field
    • setReferenceDistance

      SpatialSound setReferenceDistance(float newValue)
      Accessor method to assign float value to inputOutput SFFloat field named referenceDistance.

      Tooltip: [0,+infinity) referenceDistance for reducing volume as source moves further from the listener. For distances less than this value, volume is not reduced.
      Parameters:
      newValue - is new value for the referenceDistance field.
      Returns:
      SpatialSound - namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).
    • getRolloffFactor

      float getRolloffFactor()
      Provide float value within allowed range of [0,infinity) from inputOutput SFFloat field named rolloffFactor.

      Tooltip: [0,+infinity) rolloffFactor indicates how quickly volume is reduced as source moves further from listener.
      Returns:
      value of rolloffFactor field
    • setRolloffFactor

      SpatialSound setRolloffFactor(float newValue)
      Accessor method to assign float value to inputOutput SFFloat field named rolloffFactor.

      Tooltip: [0,+infinity) rolloffFactor indicates how quickly volume is reduced as source moves further from listener.
      Parameters:
      newValue - is new value for the rolloffFactor field.
      Returns:
      SpatialSound - namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).
    • getSpatialize

      boolean getSpatialize()
      Provide boolean value from initializeOnly SFBool field named spatialize.

      Tooltip: Whether to spatialize sound playback relative to viewer.
      • Hint: only effective within the auralization volume.
      Returns:
      value of spatialize field
    • setSpatialize

      SpatialSound setSpatialize(boolean newValue)
      Accessor method to assign boolean value to initializeOnly SFBool field named spatialize.

      Tooltip: Whether to spatialize sound playback relative to viewer.
      • Hint: only effective within the auralization volume.
      Parameters:
      newValue - is new value for the spatialize field.
      Returns:
      SpatialSound - namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).