natiny_audio_source_set_volume
void natiny_audio_source_set_volume(NatinyAudioSource source, float volume);
Sets a source's linear gain before master volume is applied.
Parameters
| Name | Type | Description |
|---|---|---|
source |
NatinyAudioSource |
Source handle |
volume |
float |
Linear gain; 1.0f is unchanged and 0.0f is silent |
Example
natiny_audio_source_set_volume(source, 0.6f);
Notes
- Sources start at volume
1.0f. Negative values are clamped to0.0f; values above1.0fare allowed and can cause clipping. - Distance attenuation multiplies this value for spatial sources.
- Invalid and non-source handles are ignored.