Skip to content

REVO / API version 0.0.10

Audio

Use LocalAudio to create playback. Objects remain valid after playback finishes or stops. Spatial audio follows its dimension. Attached audio inherits the entity dimension. Frontend audio plays across dimensions.

Property Type Details
attachedEntity
readonly
Entity | null —
category
readonly
string | null —
dimension
readonly
number World ID, default 0. Writable on local objects created by this resource. The server controls other objects. globalDimension makes the object visible in every numbered world.

Inherited from Streamable.dimension
effects
readonly
readonly AudioEffect[] —
error
readonly
string Empty when no playback error has occurred.
id
readonly
number Inherited from Streamable.id
isSpatial
readonly
boolean —
isStreamedIn
readonly
boolean Inherited from Streamable.isStreamedIn
loop
readonly
boolean —
mix
readonly
Readonly<IAudioMixSettings> —
state
readonly
AudioState —
streamDistance number | null Per-object distance in metres. null uses the streamer’s default.

Inherited from Streamable.streamDistance
streamingEnabled boolean Enables automatic streaming. Disabling it preserves the current streaming state. A dimension mismatch still suspends it until its dimension is visible again.

Inherited from Streamable.streamingEnabled
type
readonly
BaseType Inherited from Streamable.type
valid
readonly
boolean Inherited from Streamable.valid
volume
readonly
number —
all
static readonly
readonly Audio[] Overrides Streamable.all
count
static readonly
number Overrides Streamable.count
Accessor Type Details
pos Read: Vector3
Write: IVector3
Inherited from Streamable.pos
quaternion Read: Quaternion
Write: IQuaternion
Inherited from Streamable.quaternion
rot Read: Vector3
Write: IVector3
Euler angles in radians, applied X, then Y, then Z.

Inherited from Streamable.rot

attachTo(entity): boolean

Attaches spatial playback without restarting it. Returns false if it cannot attach.

Parameter Type
entity Entity

boolean


detach(): boolean

Continues at the last attachment position.

boolean


getSyncedMeta<K>(key): ICustomBaseSyncedMeta[K] | undefined

Returns a copy. Client-only objects have no synced metadata.

Type Parameter
K extends never
Parameter Type
key K

ICustomBaseSyncedMeta[K] | undefined

Streamable.getSyncedMeta

getSyncedMeta<T>(key): T | undefined

Returns a copy. Client-only objects have no synced metadata.

Type Parameter Default type
T TransportValue
Parameter Type
key string

T | undefined

Streamable.getSyncedMeta


getSyncedMetaKeys(): string[]

string[]

Streamable.getSyncedMetaKeys


hasSyncedMeta(key): boolean

Parameter Type
key string

boolean

Streamable.hasSyncedMeta


setMix(settings, fadeSeconds?): void

Changes the local mix without seeking. Fade: 0..60 seconds. Non-spatial audio requires blend 0. Applies to newly decoded audio. Queued audio keeps its mix. Persists across streaming. Stopping this resource restores prior settings unless another resource changed them.

Parameter Type
settings Partial<IAudioMixSettings>
fadeSeconds? number

void


stop(): void

Stops playback without destroying the object.

void


static getById(id): Audio | null

Parameter Type
id number

Audio | null

Streamable.getById

Playing your first sound