Skip to content

Audio

Represents a single audio clip that can be played in the world.

Represents a single audio clip that can be played in the world.

An absolute url to an audio file, or an asset url from an audio file embedded in the app.

Currently only mp3 files are supported.

The audio volume. Defaults to 1.

Whether the audio should loop. Defaults to false.

The type of audio being played. Choose music for ambient sounds or live event music etc. Choose sfx for short sound effects that happen throughout the world.

Users are able to adjust the global audio volume for these groups independently.

Defaults to music.

Whether music should be played spatially and heard by people nearby. Defaults to true.

.distanceModel: Enum(‘linear’, ‘inverse’, ‘expontential’)

Section titled “.distanceModel: Enum(‘linear’, ‘inverse’, ‘expontential’)”

When spatial is enabled, the distance model to use. Defaults to inverse.

When spatial is enabled, the reference distance to use. Defaults to 1.

When spatial is enabled, the max distance to use. Defaults to 40.

When spatial is enabled, the rolloff factor to use. Defaults to 3.

When spatial is enabled, the cone inner angle to use. Defaults to 360.

When spatial is enabled, the cone inner angle to use. Defaults to 360.

When spatial is enabled, the cone inner angle to use. Defaults to 0.

Gets and sets the current playback time, in seconds.

Inherits all Node properties

Plays the audio.

NOTE: If no click gesture has ever happened within the world, playback won’t begin until it has.

Pauses the audio, retaining the current time.

Stops the audio and resets the time back to zero.