Vizard 7 » Command Index » Vizard objects » node3d » <node3d>.playsound
7.7

<node3d>.playsound

This method plays a WAV file from the 3D location of the object

<node3d>.playsound(  
filename  
flag = viz.PLAY  
node = ''  
)  
filename
Specifies the name of the WAV file.
flag = viz.PLAY
Specifies any special play modes:

Playsound Modes

viz.LOOP

Play the sound from beginning to end continuously.

viz.STOP

Stop a playing sound.

viz.PLAY

Continue playing a stopped or paused sound.

viz.PAUSE

Pause a playing sound.

node = ''
Name of sub-node or bone to attach the sound to.

Remarks

Use this method to play a WAV file ansynchronously through the system sound card and spatialize it to the 3D location of the object. The 3D spatialization algorithms used will depend on what hardware is available, but the underlying software SDK is Microsoft DirectSound based. If there is hardware support for advanced spatialization features (e.g., head-related transfer function, echoic surfaces, and reverberation), this will be utilized if the system's sound settings are set to take full advantage of hardware acceleration. Otherwise, software implemented algorithms of DirectSound will be used for spatialization.

Note: The coordinates used in generating the 3D sound effects are based on the location of the child object and not the location of actual geometry within the object. To get correct results, it is best to model the object centered about the origin so that the coordinates system of the child object and the geometry coincide.

Return Value

None

Example

hedra = viz.add('tut_hedra.wrl')
hedra.playsound('boing!.wav')

See also

<viz>.playSound
<viz>.setDebugSound3D
<viz>.setListenerSound3D