natiny.audio.set_master_volume
natiny.audio.set_master_volume(volume)
Sets the final gain applied to the complete audio mix.
Parameters
| Name | Type | Description |
|---|---|---|
volume |
number |
Linear gain; 1.0 is unchanged and 0.0 is silent |
Example
natiny.audio.set_master_volume(0.5)
Notes
- The initial master volume is
1.0. Negative values are clamped to0.0; values above1.0are allowed. - The final output is clipped to
-1.0 .. 1.0, so high gain can distort.