REVO / API version 0.0.10
Audio
Created stopped, with a shared playback timeline. The default audience is all players. Spatial audio follows distance and dimension limits, plus entity streaming when attached. Attached audio inherits the entity’s dimension. Detach before changing it. Frontend audio ignores dimensions. Loading, buffering, errors and completion are local to each listener and emit no server events.
Extends
Section titled “Extends”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new Audio(
source,options?):Audio
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
source |
IAudioSource |
options? |
IAudioOptions |
Returns
Section titled “Returns”Audio
Overrides
Section titled “Overrides”WorldBase.constructor
Properties
Section titled “Properties”| Property | Type | Details |
|---|---|---|
attachedTo |
Entity | null |
— |
category |
string |
— |
dimension |
number |
Dimension: 0..4294967294, default 0. globalDimension shows entities and spatial audio in every dimension. Players cannot use globalDimension. Global entities share movement, damage and seats across dimensions. A vehicle’s trailer follows its dimension. Occupants follow unless the new dimension is global. |
everyone |
boolean |
— |
id |
number |
|
loop |
boolean |
— |
networkId |
number | null |
— |
playbackPosition |
number |
Seconds on the server’s playback timeline. Keeps increasing across loops. Always 0 for live URLs. |
source |
Readonly<IAudioSource> |
— |
spatial |
boolean |
— |
state |
AudioPlaybackState |
Server playback state. Unchanged when a recording finishes on a client. |
streamDistance |
number |
— |
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”addPlayer()
Section titled “addPlayer()”addPlayer(
player):boolean
Switches to an explicit player list, adding this player.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
player |
Player |
Returns
Section titled “Returns”boolean
attachTo()
Section titled “attachTo()”attachTo(
entity):boolean
Attaches spatial audio without seeking. Destroying the entity stops playback and clears the attachment.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
entity |
Entity |
Returns
Section titled “Returns”boolean
clearPlayers()
Section titled “clearPlayers()”clearPlayers():
void
Switches to an empty explicit audience.
Returns
Section titled “Returns”void
deleteSyncedMeta()
Section titled “deleteSyncedMeta()”deleteSyncedMeta(
key):void
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
key |
string |
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”destroy()
Section titled “destroy()”destroy():
void
Stops replication and deletes the audio object.
Returns
Section titled “Returns”void
detach()
Section titled “detach()”detach():
boolean
Continues at the last attached position. Assigning pos/rot also detaches spatial audio. Only spatial audio can be moved or attached. The spatial mode is fixed at creation.
Returns
Section titled “Returns”boolean
getSyncedMeta()
Section titled “getSyncedMeta()”Call Signature
Section titled “Call Signature”getSyncedMeta<
K>(key):ICustomBaseSyncedMeta[K] |undefined
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
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”hasPlayer()
Section titled “hasPlayer()”hasPlayer(
player):boolean
Whether the player belongs to the audience. Playback also depends on streaming and listener settings.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
player |
Player |
Returns
Section titled “Returns”boolean
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”pause()
Section titled “pause()”pause():
boolean
Returns
Section titled “Returns”boolean
play()
Section titled “play()”play():
void
Restarts at zero. Late listeners join the current point. Live URLs join the broadcast.
Returns
Section titled “Returns”void
removePlayer()
Section titled “removePlayer()”removePlayer(
player):void
Removes a player from the explicit list. Has no effect in everyone mode.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
player |
Player |
Returns
Section titled “Returns”void
resume()
Section titled “resume()”resume():
boolean
Resumes a paused recording. Live URLs reconnect to the broadcast.
Returns
Section titled “Returns”boolean
seek()
Section titled “seek()”seek(
seconds):boolean
0..1e9 seconds. Returns false for live URLs. Does not change playing/paused/stopped state.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
seconds |
number |
Returns
Section titled “Returns”boolean
setEveryone()
Section titled “setEveryone()”setEveryone():
void
Restores the default audience and clears the explicit player list.
Returns
Section titled “Returns”void
setSyncedMeta()
Section titled “setSyncedMeta()”Call Signature
Section titled “Call Signature”setSyncedMeta<
K>(key,value):void
Copies and replicates the value to the object’s audience. Player metadata also goes to that player.
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
K extends string |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
key |
K |
value |
K extends never ? ICustomBaseSyncedMeta[K] : TransportValue |
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”Call Signature
Section titled “Call Signature”setSyncedMeta(
values):void
Atomically merges own enumerable fields. Unsupported values reject the entire batch.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
values |
Partial<ICustomBaseSyncedMeta> & Record<string, TransportValue> |
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”stop()
Section titled “stop()”stop():
void
Stops playback but retains this 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
Overrides
Section titled “Overrides”getByNetworkId()
Section titled “getByNetworkId()”
staticgetByNetworkId(networkId):Audio|null
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
networkId |
number |
Returns
Section titled “Returns”Audio | null