The Audio component allows you to play audio resources and 3D sound effects. It supports spatialization and basic controls - such as stop and start - using WAV, MP3, and OGG format files. Loaded file and Streamed file audio components require an audio resource, which is the audio file you want to play.
File name of the resource to load. By default this is assumed to be a relative path from the executable file.
Loads the entire audio file in the memory. For large files sizes you may use the createStreamedFileAudioResource method instead.
Flags that fileName as an absolute path name instead of a relative path.
Optional file descriptor that points to a resource.
If you are loading a resource from an absolute path, and that path is not the current process path, set this field to the equivalent base path in the other client directory. This allows path relative dependencies to solve a fully qualified (absolute) path outside of the current process. This value defaults to the currently executing process root.
If true, play the sound once and delete the node. If false the audio node will stay until the scenegraph is destroyed.
If true, the file resource is compressed and is decoded when playing. If false, the file resource is uncompressed PCM data.
Sets the current operation: start, stop, pause, resume
Sets audio playback to repeat mode. If enabled, audio plays from the start after reaching the end until disabled. When audio is created this is disabled by default.
Mutes or unmutes the sound.
Sets the sound pitch. The range of the pitch is 0.5 to 2.0, with 0.5 being one octave down and 2.0 being one octave up.
Sets the audio volume. The range of the volume is 0 to 8, with 0 for silence, 1 for unity gain, and 8 for 8x gain.
Enables or disables the capability for spatial sound. If enabled, spatialSoundPositionmust have a value for positional sound to be effective.
Sets the starting point for playback of a streamed-file sound.
Sets the sound direction of a given audio channel. This is effective only if spatial sound is enabled (spatialSoundEnable) for an audio node. The direction is relative to the node's local orientation. By default the direction is the same as the parent node's orientation. If the audio file is already playing, the direction changes during playback when the sound direction is set.
Sets the direct send levels for one channel of a sound output. When 3D audio processing is enabled for a sound output (spatialSoundEnabled) this property sets the send levels for the direct component of the sound, i.e., the audio mix for the part of the sound not affected by room acoustics. Multi-channel sounds require the direct send levels to be set individually for each channel by calling this function once for each channel. For mono sounds use channel = 0. For stereo sounds use channel = 0 for left and channel = 1 for right.
Sets spatial sound distance parameters for a given channel.
Sets the position of a given audio channel relative to the node's local position. This is effective only if spatial sound is enabled (spatialSoundEnable) for an audio node. This changes the position even if the audio clip is already playing.
Sets spatial sound radiation parameters for a given channel.
Sets the room send levels for one channel of a sound output. When 3D audio processing is enabled for a sound output (spatialSoundEnabled) this function sets the send levels for the room component of the sound, i.e., the audio mix for the part of the sound that is affected by room acoustics. Multi-channel sounds require the room send levels to be set individually for each channel by calling this function once for each channel. For mono sounds use channel = 0. For stereo sounds use channel = 0 for left and channel = 1 for right.