Skip to content

REVO / API version 0.0.10

LocalAudio

Loads and plays a resource file or HTTP(S) URL asynchronously. Requires AudioCategory.available. Destroyed when this resource stops. Live URLs cannot loop. Spatial files pause outside streaming range. URLs reconnect on return.

new LocalAudio(source, options?): LocalAudio

Parameter Type
source IAudioSource
options? ILocalAudioOptions

LocalAudio

Audio.constructor

Property Type Details
attachedEntity
readonly
Entity | null Inherited from Audio.attachedEntity
category
readonly
string | null Inherited from Audio.category
dimension 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.

Overrides Audio.dimension
effects readonly AudioEffect[] Overrides Audio.effects
error
readonly
string Empty when no playback error has occurred.

Inherited from Audio.error
id
readonly
number Inherited from Audio.id
isSpatial
readonly
boolean Inherited from Audio.isSpatial
isStreamedIn
readonly
boolean Inherited from Audio.isStreamedIn
loop boolean Overrides Audio.loop
mix
readonly
Readonly<IAudioMixSettings> Inherited from Audio.mix
state
readonly
AudioState Inherited from Audio.state
streamDistance number | null Per-object distance in metres. null uses the streamer’s default.

Inherited from Audio.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 Audio.streamingEnabled
type
readonly
BaseType Inherited from Audio.type
valid
readonly
boolean Inherited from Audio.valid
volume number Gain in dB, -100..12. Changes apply while playback is active.

Overrides Audio.volume
all
static readonly
readonly LocalAudio[] Audio created by this resource.

Overrides Audio.all
count
static readonly
number Overrides Audio.count
Accessor Type Details
pos Read: Vector3
Write: IVector3
Inherited from Audio.pos
quaternion Read: Quaternion
Write: IQuaternion
Inherited from Audio.quaternion
rot Read: Vector3
Write: IVector3
Euler angles in radians, applied X, then Y, then Z.

Inherited from Audio.rot

attachTo(entity): boolean

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

Parameter Type
entity Entity

boolean

Audio.attachTo


destroy(): void

Stops playback and releases the object.

void


detach(): boolean

Continues at the last attachment position.

boolean

Audio.detach


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

Audio.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

Audio.getSyncedMeta


getSyncedMetaKeys(): string[]

string[]

Audio.getSyncedMetaKeys


hasSyncedMeta(key): boolean

Parameter Type
key string

boolean

Audio.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

Audio.setMix


stop(): void

Stops playback without destroying the object.

void

Audio.stop


static getById(id): LocalAudio | null

Parameter Type
id number

LocalAudio | null

Audio.getById

Playing your first sound