audio node

Summary

The audio node plays an audio clip. This node is appropriate for longer clips such as background sound or music. For short, incidental, sounds consider the play action node.

By default, the audio node does not play at the start of a scene. To play the sound, set the startonload attribute to true or use the setaudio action node.

An audio node has a position in the scene in the same way that an object node does. Although not present in this version of the platform, the position may be used in the future to alter the volume of the sound based on its distance from the camera. As a consequence of this, other attributes are documented here, including scale and rotation, although they have no influence on the operation of the node.

Children

In this version of the platform, the audio node does not accept any children. Future releases are likely to include some audio event handling capabilities.

Example B.1. Use of audio node

<audio filename="mymusic.ogg" startonload="true"/>

Attributes

audio attributes
nametypedefaultnotes
filenamefilenamethis attribute must be specifiedpath of the sound file to play. See Media - Audio for a list of supported file types.
startonloadtrue or falsefalsewhether or not the audio should start playing when the scene is loaded

Attributes common to transformable nodes
nametypedefaultnotes
positionx y z0 0 0position of the node relative to its parent (or the center of the screen or camera, see relativeto)
scalex y z1 1 1scale of the node relative to its parent (or the center of the screen or camera, see relativeto)
rotationyaw pitch roll0 0 0rotation of the node, in degrees, relative to its parent (or the center of the screen or camera, see relativeto)
relativeto"parent", "screen" or "camera"parentwhether this node is located relative to its parent node, the screen, or the camera. See Viewport-relative Content for more information.
billboardbooleanfalsebillboarded geometry always faces the camera
filldepthbufferbooleantruewhether the depth buffer is filled for this geometry

Attributes common to nodes
nametypedefaultnotes
visiblebooleantrueIf false, this node (or its children, if it has any) will not be rendered.
colorr g b a (in range 0 to 1)1 1 1 1specifies the color used to modulate this node and its children
idstring an identifier used to refer to this node