Page 1 of 1

fade in/out when play/stop sound ?

PostPosted: Sat Jul 25, 2015 14:14
by Matmine
Hi all,


I'm looking for a way to get a fade in when playsound et and fade out when stopsound, can i achieve this with lua scripts or differently ?

thanks !
--
Matmine

Re: fade in/out when play/stop sound ?

PostPosted: Sat Jul 25, 2015 14:40
by Krock
You can't modify the played sound with Lua, use AudaCity or any other music editor.

Re: fade in/out when play/stop sound ?

PostPosted: Sat Jul 25, 2015 16:18
by BrandonReese
Matmine wrote:Hi all,


I'm looking for a way to get a fade in when playsound et and fade out when stopsound, can i achieve this with lua scripts or differently ?

thanks !
--
Matmine


Nope, you would have to do what Krock suggested and add fades to the beginning and end of your sound, but that doesn't help if it needs to stop in the middle and fade out.

I added fading to the client side sounds in my fork but I had to modify the openal class. So it's possible with modifications to the engine. It would be a nice thing to have on the lua side, something that could be used instead of playsound and stopsound.

minetest.fadeinsound("sound")
minetest.fadeoutsound("sound")

Re: fade in/out when play/stop sound ?

PostPosted: Sun Jul 10, 2016 05:18
by BrandonReese
I created a pull request that would add fading sounds in and out to the modding api.

https://github.com/minetest/minetest/pull/4304