diff --git a/src/main.gd b/src/main.gd index 928b95f..13463ff 100644 --- a/src/main.gd +++ b/src/main.gd @@ -37,21 +37,19 @@ func _play(): print("NO SONG COULD BE FOUND") return - if volume_tween: volume_tween.kill() - volume_tween = create_tween() - volume_tween.tween_property(audio_stream_player, "volume_db", -30, 3) - volume_tween.tween_callback(func(): - audio_stream_player.stream = load(song.track) - ) - volume_tween.tween_property(audio_stream_player, "volume_db", 0, 3) - - + audio_stream_player.volume_db = -30 + audio_stream_player.stream = load(song.track) audio_stream_player.play() music_display.show_song(song) current_track = song + + volume_tween = create_tween() + volume_tween.tween_property(audio_stream_player, "volume_db", 0, 3) + volume_tween.tween_interval(audio_stream_player.stream.get_length() - 3) + volume_tween.tween_property(audio_stream_player, "volume_db", -30, 3) func _stop():