X3D support for multimedia is achieved through these three nodes: AudioClip (audio data node), Sound (Audio playback node), and movietexture (Image texture node).
In this lecture, let's briefly introduce the properties of these three nodes, and then give some examples to illustrate the use of these nodes and the playback of audio and video.
One, audio and video nodes
1, AudioClip (audio data) node
AudioClip is generally used as a child node of sound, which provides audio data, and its main properties are:
Description--The hint text displayed by this node.
URL-the location of the sound file. The file is usually. wav format or. midi format, and other formats may not necessarily be supported.
Loop--loops playback. Loops when Loop=true, when Loop=false is only run once. The default value is False.
Pitch-the multiplication factor that speeds up or slows down playback sounds (for example: 2.0 means playing at twice times), only positive values are valid. The default value is 1.
StartTime-the time (in seconds) that the sound starts to play. The default value is 0.
StopTime-the time (in seconds) to end the playback of the sound. The default value is 0.
Note that if the loop is set to True, the sound loops until stoptime stops, and if the loop is set to False, the sound plays to the end of the file at once or reaches StopTime.
2, Sound (audio playback) node
The main properties of the Sound node for playback of sound are:
Intensity--the intensity of the sound source, 0 is the minimum value, 1 is the maximum value. In some browsers the maximum value can exceed 1. The default value is 1.
Priority--Indicates the priority of the sound. If it is a background music, set to 0.
Location--The coordinates of the sound source. The default value is [0 0 0].
Direction--Specifies the direction of the long axis of the ellipsoid. The default value is [0 0 1].
Minfront--The distance from the source coordinate point to the front end of the inner ellipse ball. The default value is 1.
Maxfront--The distance from the source coordinate point to the front end of the outer elliptic sphere. The default value is 10.
Minback--The distance from the source coordinate point to the rear end of the inner ellipse ball. The default value is 1.
Maxback--The distance from the source coordinate point to the rear end of the outer elliptic sphere. The default value is 10.
Spatialize--Indicates whether the sound is played as a space point (True) or as an ambient sound (False). The default value is true.
The location relationships involved in the above attributes can be represented by the following figure.