Set
These are setters
Set Volume
exports['mx-surround']:setVolumeMax(soundId, volume, disableOverWrite)Parameters
soundId:
stringvolume:
numberdisableOverWrite?:
booleanIf true, volume will not be overwritten by sound profile
Set Streamer Mode
exports['mx-surround']:setStreamerMode(bool)Parameters
bool:
boolean
Set Type
exports['mx-surround']:setStereoMode(soundId, stereo)Parameters
soundId:
stringstereo:
booleanIf this is false, it will be spatial (3D)
Set Panner
Parameters
soundId:
stringpanner:
PannerNode
Set Coords
Parameters
soundId:
stringcoords:
vector3xSound?:
boolean
Set TimeStamp
Parameters
soundId:
stringtimeStamp:
number
Set Loop
Parameters
soundId:
stringloop:
boolean
Set Max Distance
Parameters
soundId:
stringmaxDistance:
number
Set Destroy On Finish
Parameters
soundId:
stringdestroyOnFinish:
boolean
Disable Interior Filter
It allows you to disable or enable effects that make sound appear to come from within an interior. If you are playing small sounds like stove sounds in a interior, it will also disable the feature that plays them in stereo rather than 3D. Therefore, it is very useful for particle sounds.
Parameters
soundId:
stringdisableFilter:
boolean
Disable Vehicle Filter
Parameters
soundId:
stringdisableFilter:
boolean
Set Rolloff
How far a sound carries. Raise it for sirens and alarms that should be heard across a block, lower it for something that should stay in one room.
Parameters
soundId:
string | numberscale:
number1.0is normal.3.0carries about three times further
plateau?:
numberMetres of full volume around the source before any falloff starts. Defaults to
0.0
Set Emitters
Render one sound from several speaker positions at once, the way a venue drives a room. Each emitter gets its own distance attenuation and occlusion, so the music spreads through the room instead of coming from a single point.
Parameters
soundId:
string | numberemitters:
vector3[] | nilUp to 8 positions; anything past that is ignored
nilor an empty table restores a single emitter at the sound's coords
Returns
true | false
Set Fills Space
Make a sound fill the space around the listener instead of staying a point source. Inside the space it stops being directional, which is what a room full of speakers actually sounds like.
Pass a polygon for the full behaviour: anywhere inside it the sound is fully non-directional, and it fades back to positional over margin metres outside. A sphere works too when you only have a centre point.
Parameters
soundId:
string | numberoptions:
boolean | tablefalsedisables it,trueenables it with defaultspolygon?:
{ x: number, y: number }[]— the room footprint, at least 3 pointsminZ? / maxZ?:
number— floor and ceiling of the footprintmargin?:
number— metres it takes to fade back to positional outside. Default12.0inner? / outer?:
number— sphere radii, used when there is no polygoncoords?:
vector3— centre of the spheremaxLeakage?:
number—0.0-1.0, how much escapes the space. Default1.0interior?:
boolean— sharing an interior with the listener fills it. Defaulttrue
Returns
true | false
Set Leak Distance
Let a sound bleed through walls purely by proximity — the muffled club music through a wall effect. The sound stays occluded, it just does not disappear because there is no open door.
Parameters
soundId:
string | numberoptions:
boolean | tablefalsedisables itmin?:
number— inside this distance leakage is at full strength. Default0.0max?:
number— leakage fades to nothing by here. Default25.0maxLeakage?:
number—0.0-1.0, strongest leak. Default0.5
Returns
true | false
Set Sync Trim
Run a sound fractionally fast or slow to close a small timing gap without seeking. A seek on a stream rebuffers and is plainly audible; half a percent of speed is not, and closes the gap over the next minute.
Rates outside the inaudible range are clamped. Backends with no fine speed control ignore this entirely, so check supportsRateTrim first.
Parameters
soundId:
string | numberrate:
number1.0is normal speed
API → Client → Get
Supports Rate Trim
Whether this sound's backend can be nudged by a fraction of a percent of speed. false for YouTube, which only offers a handful of discrete speeds — callers keeping a room in step have to seek those instead.
Parameters
soundId:
string | number
Returns
boolean
Is Deafened
How badly the listener's ears are ringing right now, so your own systems can react to a nearby blast.
Returns
number0.0is normal hearing,1.0is fully deafened. Each ear recovers over about 7 seconds
Last updated