1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-10-17 18:35:20 +02:00

Clean up sound_fade (#10119)

Add proper documentation and correct gain reduction calculations.

Co-authored-by: hecktest <>
This commit is contained in:
hecks
2020-08-19 19:26:37 +02:00
committed by GitHub
parent 649211bf27
commit 5bda36143f
2 changed files with 35 additions and 27 deletions

View File

@@ -5238,9 +5238,12 @@ Sounds
* `minetest.sound_fade(handle, step, gain)`
* `handle` is a handle returned by `minetest.sound_play`
* `step` determines how fast a sound will fade.
Negative step will lower the sound volume, positive step will increase
the sound volume.
The gain will change by this much per second,
until it reaches the target gain.
Note: Older versions used a signed step. This is deprecated, but old
code will still work. (the client uses abs(step) to correct it)
* `gain` the target gain for the fade.
Fading to zero will delete the sound.
Timing
------