For the complete documentation index, see llms.txt. This page is also available as Markdown.

Set

These are setters

Set Volume

exports['mx-surround']:setVolumeMax(soundId, volume, disableOverWrite)

Parameters

  • soundId: string

  • volume: number

  • disableOverWrite?: boolean

    • If 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: string

  • stereo: boolean

    • If this is false, it will be spatial (3D)


Set Panner

Parameters

  • soundId: string

  • panner: PannerNode


Set Coords

Parameters

  • soundId: string

  • coords: vector3

  • xSound?: boolean


Set TimeStamp

Parameters

  • soundId: string

  • timeStamp: number


Set Loop

Parameters

  • soundId: string

  • loop: boolean


Set Max Distance

Parameters

  • soundId: string

  • maxDistance: number


Set Destroy On Finish

Parameters

  • soundId: string

  • destroyOnFinish: 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: string

  • disableFilter: boolean


Disable Vehicle Filter

Parameters

  • soundId: string

  • disableFilter: 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 | number

  • scale: number

    • 1.0 is normal. 3.0 carries about three times further

  • plateau?: number

    • Metres 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 | number

  • emitters: vector3[] | nil

    • Up to 8 positions; anything past that is ignored

    • nil or 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 | number

  • options: boolean | table

    • false disables it, true enables it with defaults

    • polygon?: { x: number, y: number }[] — the room footprint, at least 3 points

    • minZ? / maxZ?: number — floor and ceiling of the footprint

    • margin?: number — metres it takes to fade back to positional outside. Default 12.0

    • inner? / outer?: number — sphere radii, used when there is no polygon

    • coords?: vector3 — centre of the sphere

    • maxLeakage?: number — 0.0 - 1.0, how much escapes the space. Default 1.0

    • interior?: boolean — sharing an interior with the listener fills it. Default true

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 | number

  • options: boolean | table

    • false disables it

    • min?: number — inside this distance leakage is at full strength. Default 0.0

    • max?: number — leakage fades to nothing by here. Default 25.0

    • maxLeakage?: number — 0.0 - 1.0, strongest leak. Default 0.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 | number

  • rate: number

    • 1.0 is 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

  • number

    • 0.0 is normal hearing, 1.0 is fully deafened. Each ear recovers over about 7 seconds


Last updated