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.
Extends
Section titled “Extends”Extended by
Section titled “Extended by”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 |
— |
all |
readonly Audio[] |
|
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
detach()
Section titled “detach()”detach():
boolean
Continues at the last attachment position.
Returns
Section titled “Returns”boolean
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
stop()
Section titled “stop()”stop():
void
Stops playback without destroying the object.
Returns
Section titled “Returns”void
getById()
Section titled “getById()”
staticgetById(id):Audio|null
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
id |
number |
Returns
Section titled “Returns”Audio | null