natiny.audio.source_set_spatial
natiny.audio.source_set_spatial(source, spatial)
Sets whether a source is positioned in the 3D world.
Parameters
| Name | Type | Description |
|---|---|---|
source |
number |
Source handle |
spatial |
boolean |
Whether to use spatial rendering |
Example
natiny.audio.source_set_spatial(source, false)
Notes
- Sources are spatial by default. Spatial rendering uses the source and listener transforms, distance attenuation and the selected HRTF mode.
- Non-spatial sources ignore transforms, listeners and attenuation. Mono is sent equally to both outputs, while stereo files preserve both channels.
- Stereo spatial sources are mixed down to mono before spatial rendering.
- Invalid and non-source handles are ignored.