<<VRML 2.0 - An Introductory view by examples

Sound

[example]                                              [run] 

It specifies the spatial presentation of a sound in VRML; an AudioClip or a MovieTexture node is defined as the source of the sound. The sound source is located at location and emits sound in an elliptical pattern. The sound generation shape is defined by two ellipsoids (see Figure 6.14) of the VRML97 specification. The ellipsoids shape is controlled by minBack + minFront and maxBack + maxFront specifying more or less directional focus. Spatialize controls if the viewer will perceive sound direction (TRUE + viewer inside ellipsoids). Sound is attenuate of 0 db within the internal ellipsoid. Between the two ellipsoids there is a linear attenuation from 0 to 20 db. Outside the external ellipsoid there is no sound generation.

{
exposedField SFVec3f direction 0 0 1 # sound main propagation direction
exposedField SFFloat intensity 1 # [0,1] - sound loudness
exposedField SFVec3f location 0 0 0 # in local coord. system
exposedField SFFloat maxBack 10 # distance from left side external ellipsoid to location
exposedField SFFloat maxFront 10 # distance from location to right side of external ellipsoid
exposedField SFFloat minBack 1 # distance from left side internal ellipsoid to location
exposedField SFFloat minFront 1 # distance from location to right side of internal ellipsoid
exposedField SFFloat priority 0 # used if more than a sound node is being traversed
exposedField SFNode source NULL # an AudioClip or a MovieTexture node
field SFBool spatialize TRUE # if FALSE no directional effects
}

Usage :


    Sound {
       source AudioClip {
               url "http:// ..............."
                         }
            }