Click or drag to resize
SoVRMLSound Class

Note: This API is now obsolete.

Specifies position and spatial representation of a sound <font color="#0000FF">[Windows only]</font>.

Inheritance Hierarchy

Namespace: OIV.Inventor.VRMLnodes
Assembly: OIV.Inventor (in OIV.Inventor.dll) Version: 9.9.13.0 (9.9.13.0)
Syntax
[EditorBrowsableAttribute(EditorBrowsableState.Never)]
[ObsoleteAttribute("See documentation for more details")]
public class SoVRMLSound : SoVRMLNode

The SoVRMLSound type exposes the following members.

Constructors
  NameDescription
Public methodSoVRMLSound

Constructor.

Top
Methods
  NameDescription
Public methodAffectsState

Returns true if a node has an effect on the state during traversal.

(Inherited from SoNode.)
Public methodCallback
(Inherited from SoNode.)
Public methodCopy
Calls Copy(false).
(Inherited from SoNode.)
Public methodCopy(Boolean)

Creates and returns an exact copy of the node.

(Inherited from SoNode.)
Public methodCopyFieldValues(SoFieldContainer)
Calls CopyFieldValues(fc, false).
(Inherited from SoFieldContainer.)
Public methodCopyFieldValues(SoFieldContainer, Boolean)

Copies the contents of fc's fields into this object's fields.

(Inherited from SoFieldContainer.)
Public methodDispose
Releases all resources used by SoDisposable.
(Inherited from SoDisposable.)
Public methodDistribute
(Inherited from SoNode.)
Public methodDoAction
(Inherited from SoNode.)
Public methodEnableNotify

Notification at this Field Container is enabled (if flag == true) or disabled (if flag == false).

(Inherited from SoFieldContainer.)
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Public methodFieldsAreEqual

Returns true if this object's fields are exactly equal to fc's fields.

(Inherited from SoFieldContainer.)
Public methodGet

Returns the values of the fields of this object in the Open Inventor ASCII file format in the given string.

(Inherited from SoFieldContainer.)
Public methodGetAllFields

Returns a list of fields, including the eventIn's and eventOut's.

(Inherited from SoFieldContainer.)
Public methodGetAlternateRep

This method is called by actions to allow the node to provide an "alternate representation" when appropriate (typically depending on the action type).

(Inherited from SoNode.)
Public methodGetBoundingBox
(Inherited from SoNode.)
Public methodGetEventIn

Returns a the eventIn with the given name.

(Inherited from SoFieldContainer.)
Public methodGetEventOut

Returns the eventOut with the given name.

(Inherited from SoFieldContainer.)
Public methodGetField

Returns a the field of this object whose name is fieldName.

(Inherited from SoFieldContainer.)
Public methodGetFieldName

Returns the name of the given field in the fieldName argument.

(Inherited from SoFieldContainer.)
Public methodGetFields

Appends references to all of this object's fields to resultList, and returns the number of fields appended.

(Inherited from SoFieldContainer.)
Public methodGetHashCode
Overrides GetHashCode().
(Inherited from SoNetBase.)
Public methodGetMatrix
(Inherited from SoNode.)
Public methodGetName

Returns the name of an instance.

(Inherited from SoBase.)
Public methodGetPrimitiveCount
(Inherited from SoNode.)
Public methodGetRenderUnitID
(Inherited from SoNode.)
Public methodGetStringName (Inherited from SoBase.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodGLRender
Public methodGLRenderBelowPath
(Inherited from SoNode.)
Public methodGLRenderInPath
(Inherited from SoNode.)
Public methodGLRenderOffPath
(Inherited from SoNode.)
Public methodGrabEventsCleanup
(Inherited from SoNode.)
Public methodGrabEventsSetup
(Inherited from SoNode.)
Public methodHandleEvent
(Inherited from SoNode.)
Public methodHasDefaultValues

Returns true if all of the object's fields have their default values.

(Inherited from SoFieldContainer.)
Public methodIsBoundingBoxIgnoring

This method is used by getBoundingBox action traversal to know if the current node must be traversed or not, ie the bounding should be ignored.

(Inherited from SoNode.)
Public methodIsNotifyEnabled

Notification is the process of telling interested objects that this object has changed.

(Inherited from SoFieldContainer.)
Public methodIsOverride

Returns the state of the override flag.

(Inherited from SoNode.)
Public methodIsSynchronizable

Gets the ScaleViz synchronizable state of this object.

(Inherited from SoBase.)
Public methodPick
(Inherited from SoNode.)
Public methodRayPick
(Inherited from SoNode.)
Public methodSearch
(Inherited from SoNode.)
Public methodSet

Sets one or more fields in this object to the values specified in the given string, which should be a string in the Open Inventor file format.

(Inherited from SoFieldContainer.)
Public methodSetName (Inherited from SoBase.)
Public methodSetOverride

Turns the override flag on or off.

(Inherited from SoNode.)
Public methodSetSynchronizable

Sets this to be a ScaleViz synchronizable object.

(Inherited from SoBase.)
Public methodSetToDefaults

Sets all fields in this object to their default values.

(Inherited from SoFieldContainer.)
Public methodToString
Converts this SoBase structure to a human readable string.
(Inherited from SoBase.)
Public methodTouch

Marks an instance as modified, simulating a change to it.

(Inherited from SoNode.)
Public methodWrite
(Inherited from SoNode.)
Top
Properties
  NameDescription
Public propertydirection

The direction the ellipsoidal sound pattern is pointing.

Public propertydopplerFactor

Doppler factor value.

Public propertydopplerVelocity

Doppler velocity value in meters/sec.

Public propertyintensity

Adjusts the volume of each sound source.

Public propertyIsDisposable
ISafeDisposable interface implementation.
(Inherited from SoDisposable.)
Public propertylocation

Position of the sound source.

Public propertymaxBack

(Note: Not implemented) Around the location of the emitter, minFront and minBack determine the extent of the full intensity region in front of and behind the sound.

Public propertymaxFront

(Note: Not implemented) Around the location of the emitter, minFront and minBack determine the extent of the full intensity region in front of and behind the sound.

Public propertymetadata

Specifies the metadata node.

(Inherited from SoVRMLNode.)
Public propertyminBack

(Note: Not implemented) Around the location of the emitter, minFront and minBack determine the extent of the full intensity region in front of and behind the sound.

Public propertyminFront

Around the location of the emitter, minFront and minBack determine the extent of the full intensity region in front of and behind the sound.

Public propertypriority

(Note: Not implemented) Controls which sound is heard when more than one sound is active.

Public propertysource

Sound source for the sound node.

Public propertyspatialize

(Note: Not implemented) If true, the sound is treated as a monaural sound from a single point.

Public propertyUserData
Gets or sets the user data to be contained by the field container.
(Inherited from SoFieldContainer.)
Top
Remarks

This node has an effect only on Windows.

<font color="#0000FF">NOTE:</font> This class does not exist in Open Inventor 10.0 and later.

The SoVRMLSound node describes the positioning and spatial presentation of a sound in a VRML scene. The sound may be located at a point and emit sound in a spherical or ellipsoid pattern, in the local coordinate system. The ellipsoid is pointed in a particular direction and may be shaped to provide more or less directional focus from the location of the sound. The sound node may also be used to describe an ambient sound which tapers off at a specified distance from the sound node.

VRML97 SPECIFICATION

This section describes the expected behavior of the node in a conforming VRML97 browser application. In some cases, the application is responsible for implementing portions of the expected behavior. Open Inventor viewer classes and IVF classes implement some of the application behaviors.

This section may reference portions of the VRML97 specification that are not present in this help file. The complete VRML97 spec is available at http://www.web3d.org.

The SoVRMLSound node describes the positioning and spatial presentation of a sound in a VRML scene. The sound may be located at a point and emit sound in a spherical or ellipsoid pattern, in the local coordinate system. The ellipsoid is pointed in a particular direction and may be shaped to provide more or less directional focus from the location of the sound. The sound node may also be used to describe an ambient sound which tapers off at a specified distance from the sound node.

The SoVRMLSound node also enables ambient background sound to be created by setting of the maxFront and maxBack to the radius of the area for the ambient noise. If ambient noise is required for the whole scene then these values should be set to at least cover the distance from the location to the farthest point in scene from that point (including effects of transforms).

The source field specifies the sound source for the sound node. If there is no source specified the SoVRMLSound will emit no audio. The source field will specify either an SoVRMLAudioClip or an SoVRMLMovieTexture node. Furthermore, the SoVRMLMovieTexture node must refer to a movie format that supports sound (e.g. MPEG1-Systems).

The intensity field adjusts the volume of each sound source; The intensity is an SFFloat that ranges from 0.0 to 1.0. An intensity of 0 is silence, and an intensity of 1 is the full volume of the sound in the sample or the full volume of the MIDI clip.

The priority field gives the author some control over which sounds the browser will choose to play when there are more sounds active than sound channels available. The priority varies between 0.0 and 1.0, with 1.0 being the highest priority. For most applications priority 0.0 should be used for a normal sound and 1.0 should be used only for special event or cue sounds (usually of short duration) that the author wants the user to hear even if they are farther away and perhaps of lower intensity than some other ongoing sounds. Browsers should make as many sound channels available to the scene as is efficiently possible.

If the browser does not have enough sound channels to play all of the currently active sounds, it is recommended that the browser sort the active sounds into an ordered list using the following sort keys:

decreasing priority;

for sounds with priority > 0.5, increasing (now- startTime )

decreasing intensity at viewer location ((intensity/distance)**2);

where now represents the current time, and startTime is the startTime field of the audio source node specified in the source field.

It is important that sort key #2 be used for the high priority (event and cue) sounds so that new cues will be heard even when the channels are "full" of currently active high priority sounds. Sort key #2 should not be used for normal priority sounds so selection among them will be based on sort key #3 - intensity and distance from the viewer.

The browser should play as many sounds from the beginning of this sorted list as it has available channels. On most systems the number of concurrent sound channels is distinct from the number of concurrent MIDI streams. On these systems the browser may maintain separate ordered lists for sampled sounds and MIDI streams.

A sound's location in the scene graph determines its spatial location (the sound's location is transformed by the current transformation) and whether or not it can be heard. A sound can only be heard while it is part of the traversed scene; sound nodes that are descended from SoVRMLLOD, SoVRMLSwitch, or any grouping or prototype node that disables traversal (i.e., drawing) of its children will not be audible unless they are traversed. If a sound is silenced for a time under an SoVRMLSwitch or SoVRMLLOD node, and later it becomes part of the traversal again, the sound picks up where it would have been had it been playing continuously.

Around the location of the emitter, minFront and minBack determine the extent of the full intensity region in front of and behind the sound. If the location of the sound is taken as a focus of an ellipsoid, the minBack and minFront values, in combination with the direction vector determine the two focii of an ellipsoid bounding the ambient region of the sound. Similarly, maxFront and maxBack determine the limits of audibility in front of and behind the sound; they describe a second, outer ellipsoid. If minFront equals minBack and maxFront equals maxBack, the sound is omnidirectional, the direction vector is ignored, and the min and max ellipsoids become spheres centered around the sound node. The fields minFront, maxFront, minBack, and maxBack are scaled by the parent transformations - these values must be >= 0.0.

The inner ellipsoid defines a space of full intensity for the sound. Within that space the sound will play at the intensity specified in the sound node. The outer ellipsoid determines the maximum extent of the sound. Outside that space, the sound cannot be heard at all. In between the two ellipsoids, the intensity drops off proportionally with inverse square of the distance. With this model, an SoVRMLSound usually will have smooth changes in intensity over the entire extent is which it can be heard. However, if at any point the maximum is the same as or inside the minimum, the sound is cut off immediately at the edge of the minimum ellipsoid.

The ideal implementation of the sound attenuation between the inner and outer ellipsoids is an inverse power dropoff. A reasonable approximation to this ideal model is a linear dropoff in decibel value. Since an inverse power dropoff never actually reaches zero, it is necessary to select an appropriate cutoff value for the outer ellipsoid so that the outer ellipsoid contains the space in which the sound is truly audible and excludes space where it would be negligible. Keeping the outer ellipsoid as small as possible will help limit resources used by nearly inaudible sounds. Experimentation suggests that a 20dB dropoff from the maximum intensity is a reasonable cutoff value that makes the bounding volume (the outer ellipsoid) contain the truly audible range of the sound. Since actual physical sound dropoff in an anechoic environment follows the inverse square law, using this algorithm it is possible to mimic real-world sound attenuation by making the maximum ellipsoid ten times larger than the minimum ellipsoid. This will yield inverse square dropoff between them.

Browsers should support spatial localization of sound as well as their underlying sound libraries will allow. The spatialize field is used to indicate to browsers that they should try to locate this sound. If the spatialize field is true, the sound should be treated as a monaural sound coming from a single point. A simple spatialization mechanism just places the sound properly in the pan of the stereo (or multichannel) sound output. Sounds are faded out over distance as described above. Browsers may use more elaborate sound spatialization algorithms if they wish.

Authors can create ambient sounds by setting the spatialize field to false. In that case, stereo and multichannel sounds should be played using their normal separate channels. The distance to the sound and the minimum and maximum ellipsoids (discussed above) should affect the intensity in the normal way. Authors can create ambient sound over the entire scene by setting the minFront and minBack to the maximum extents of the scene.

Differences between the VSG implementation and the VRML97 specification

  • Support of the Doppler effect. The Doppler effect depends on the velocities of the source and the listener relative to the medium (air, water,...) and speed of sound propagation in that medium. If F is the original frequency, then F', the effective Doppler shifted frequency is computed as follows: F' = dopplerFactor * F * (dopplerVelocity-VL)/(dopplerVelocity+VS) with VL being the listener velocity and VS being the source velocity.

Limitations

  • This node is not thread safe so it does not work with the MultiPipe extension.

Note: These new fields are not compatible with VRML97. If you set these fields to non-default values and then write a VRML file, the VRML file will not be readable by standard VRML97 readers. Older versions of Open Inventor will not be able to read the file either and will generate an Inventor read error (unknown field).

  • The priority and spatialize fields are not implemented. Setting these fields has no effect.

  • If source is an SoVRMLAudioClip, only wave files (.wav extension) are supported.

  • If source is an SoVRMLMovieTexture, the sound is extracted only from AVI files.

  • minFront (but not minBack, maxFront or maxBack) is used to specify the volume space of the sound. minFront determines the radius of a sphere within which the sound is not attenuated. Outside of this sphere, the attenuation is as described by the VRML2 specification.

  • OpenAL (http://connect.creativelabs.com/openal/default.aspx), the Open Audio Library, is used for the spatialization of the sound. The OpenAL library is supplied separate from the Open Inventor libraries.

FILE FORMAT/DEFAULT

VRMLSound {
direction 0 0 1
intensity 1
location 0 0 0
maxBack 10
maxFront 10
minBack 1
minFront 1
priority 0
source NULL
spatialize true
dopplerFactor 0.0
dopplerVelocity 343
metadata NULL
}

EVENTS

eventIn

SoSFVec3fset_direction
SoSFFloatset_intensity
SoSFVec3fset_location
SoSFFloatset_maxBack (Note: Not implemented)
SoSFFloatset_maxFront (Note: Not implemented)
SoSFFloatset_minBack (Note: Not implemented)
SoSFFloatset_minFront
SoSFFloatset_priority (Note: Not implemented)
SoSFNodeset_source
SoSFNodeset_metadata

eventOut

SoSFVec3fdirection_changed
SoSFFloatintensity_changed
SoSFVec3flocation_changed
SoSFFloatmaxBack_changed (Note: Not implemented)
SoSFFloatmaxFront_changed (Note: Not implemented)
SoSFFloatminBack_changed (Note: Not implemented)
SoSFFloatminFront_changed
SoSFFloatpriority_changed (Note: Not implemented)
SoSFNodesource_changed
SoSFNodemetadata_changed
Obsoletesince Open Inventor 9500 The VRML API is no longer supported. See section http://oivdoc95.vsg3d.com/content/compatibility-notes-4#Deprecation of the Reference Manual.

See Also