I'm making a music player in Godot and it's going pretty well, but I've run into a problem; I can only have the seek slider work when it's paused... here's my code:
func _on_SongTime_value_changed(value):
if playing:
pass
else:
audio_player.seek(value)
That's the current code I have and that basically makes it so that I'm not running into the problem that it's constantly calling the seek(value)
function when the slider value progresses due to the song playing. Here's my old code:
func _on_SongTime_value_changed(value):
audio_player.seek(value)
The problem with that is when the song progressed, causing the slider to move, the _on_SongTime_value_changed(value)
event is called, causing it to call the seek(value)
function over and over again due to this code:
func _process(delta):
if playing:
time_slider.value = audio_player.get_playback_position()
And this is kind of annoying to have to pause the song just to seek to a different timestamp, so I need to fix this ASAP ;).
Thanks in advance!