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.
Extends
Section titled “Extends”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new LocalAudio(
source,options?):LocalAudio
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
source |
IAudioSource |
options? |
ILocalAudioOptions |
Returns
Section titled “Returns”LocalAudio
Overrides
Section titled “Overrides”Audio.constructor
Properties
Section titled “Properties”| Property | Type | Details |
|---|---|---|
attachedEntity |
Entity | null |
|
category |
string | null |
|
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. |
effects |
readonly AudioEffect[] |
|
error |
string |
Empty when no playback error has occurred. |
id |
number |
|
isSpatial |
boolean |
|
isStreamedIn |
boolean |
|
loop |
boolean |
|
mix |
Readonly<IAudioMixSettings> |
|
state |
AudioState |
|
streamDistance |
number | null |
Per-object distance in metres. null uses the streamer’s default. |
streamingEnabled |
boolean |
Enables automatic streaming. Disabling it preserves the current streaming state. A dimension mismatch still suspends it until its dimension is visible again. |
type |
BaseType |
|
valid |
boolean |
|
volume |
number |
Gain in dB, -100..12. Changes apply while playback is active. |
all |
readonly LocalAudio[] |
Audio created by this resource. |
count |
number |
Accessors
Section titled “Accessors”| Accessor | Type | Details |
|---|---|---|
pos |
Read: Vector3Write: IVector3 |
|
quaternion |
Read: QuaternionWrite: IQuaternion |
|
rot |
Read: Vector3Write: IVector3 |
Euler angles in radians, applied X, then Y, then Z. |
Methods
Section titled “Methods”attachTo()
Section titled “attachTo()”attachTo(
entity):boolean
Attaches spatial playback without restarting it. Returns false if it cannot attach.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
entity |
Entity |
Returns
Section titled “Returns”boolean
Inherited from
Section titled “Inherited from”destroy()
Section titled “destroy()”destroy():
void
Stops playback and releases the object.
Returns
Section titled “Returns”void
detach()
Section titled “detach()”detach():
boolean
Continues at the last attachment position.
Returns
Section titled “Returns”boolean
Inherited from
Section titled “Inherited from”getSyncedMeta()
Section titled “getSyncedMeta()”Call Signature
Section titled “Call Signature”getSyncedMeta<
K>(key):ICustomBaseSyncedMeta[K] |undefined
Returns a copy. Client-only objects have no synced metadata.
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
K extends never |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
key |
K |
Returns
Section titled “Returns”ICustomBaseSyncedMeta[K] | undefined
Inherited from
Section titled “Inherited from”Call Signature
Section titled “Call Signature”getSyncedMeta<
T>(key):T|undefined
Returns a copy. Client-only objects have no synced metadata.
Type Parameters
Section titled “Type Parameters”| Type Parameter | Default type |
|---|---|
T |
TransportValue |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
key |
string |
Returns
Section titled “Returns”T | undefined
Inherited from
Section titled “Inherited from”getSyncedMetaKeys()
Section titled “getSyncedMetaKeys()”getSyncedMetaKeys():
string[]
Returns
Section titled “Returns”string[]
Inherited from
Section titled “Inherited from”hasSyncedMeta()
Section titled “hasSyncedMeta()”hasSyncedMeta(
key):boolean
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
key |
string |
Returns
Section titled “Returns”boolean
Inherited from
Section titled “Inherited from”setMix()
Section titled “setMix()”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.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
settings |
Partial<IAudioMixSettings> |
fadeSeconds? |
number |
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”stop()
Section titled “stop()”stop():
void
Stops playback without destroying the object.
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”getById()
Section titled “getById()”
staticgetById(id):LocalAudio|null
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
id |
number |
Returns
Section titled “Returns”LocalAudio | null