Topic was automatically imported from the old Question2Answer platform.
Asked By
Robster
Old Version
Published before Godot 3 was released.
Hi all,
Does anyone have some tips on how to do this? I am using a Streamplayer and as the scenes change I change the music. It just cuts off though. I’d like to do a fade or even better a crossfade between song files.
The script would expose helper functions for playing and cross-fading music.
Then save this as a scene, make it a singleton with auto-load, so it will continue playing/update as you change scenes, and you will be able to access it from all scenes.
Now all you have to do is to implement a “cross fade” within the script, which can be done by playing something on both StreamPlayers and using two Tweens to change the volumes over time.
Edit: it made me want to investigate that… and I came up with an easy to use music manager that can play music with multiple cross-fade and delaying support (without tweens though). Pretty basic but works well, I might submit it on Github and the assetlib
You need only one tween though, as they can interpolate many values at once.
I guess I wanted to just keep the one streamplayer and hopefully play both songs at once in different channels or similar but that will definitely work.
I didn’t realise the tweening was so capable and able to be used in so many different ways. Thanks so much for the advice.