Skip to main content

Sounds Prefabs

Sounds

This array contains audio tracks associated with the effect. You can enable several audio tracks at once.

Audio

A simple background audio track that loops by default.

Usage

"sounds": [
{
"audio": {
"filename": "sound.ogg",
"start": 0,
"end": 10,
"loop": true,
"volume": 0.7
}
// ...
}
// ...
]
ParameterDescriptionOptionalDefault Value

filename

Path to an audio track. The supported formats are .ogg and .wav.

++

start

Playback start position in seconds.

`${props.title} icon`

0

end

Playback end position in seconds. When omitted, playback continues to the end of the track.

`${props.title} icon`

null

loop

Loops the audio track.

`${props.title} icon`

true

volume

Audio-track volume in the range [0, 1].

`${props.title} icon`

1

note

To use the audio prefab on the web, you must call player.setVolume(1); in your code.