qurage
September 9, 2024, 4:41pm
1
Godot Version
Godot 4.3 & 4.4-dev
windows 11 pro
Question
When I assign AudioStreamOggVorbis directly to AudioStreamPlayer.stream, AudioStreamPlayer.get_playback_position() works correctly.
However, when I use AudioStreamInteractive, AudioStreamPlayer.get_playback_position() returns 0.
Is this the intended behavior?
1 Like
mchamby
September 9, 2024, 8:32pm
2
I’ve noticed this too and it’s really unfortunate. It’s almost certainly a bug. I’d like to report the bug on GitHub when I get the chance but feel free to do it first!
As a workaround, I calculate the song runtime using Time.get_ticks_usec to get how much real time has elapsed. But it’s really not stable and I don’t recommend it!
1 Like
qurage
September 9, 2024, 9:11pm
3
Thank you for the advice. It doesn’t seem to be an issue with my development environment, which is unfortunate.
Is anyone else experiencing the same issue?
If so, I will mark this question as a ‘bug’ and consider it resolved
1 Like
I wrote a bug report on the GitHub and KingTheFifth has already written a fix for it!
opened 10:25PM - 03 Oct 24 UTC
### Tested versions
Reproducible in 4.3.stable.official [77dcf97d8].
Not repro… ducible before 4.3 as AudioStreamInteractive did not exist.
### System information
Godot v4.3.stable - Windows 10.0.22631 - Vulkan (Forward+) - dedicated AMD Radeon RX 6600 (Advanced Micro Devices, Inc.; 32.0.11037.4004) - AMD Ryzen 5 5600X 6-Core Processor (12 Threads)
### Issue description
When using AudioStreamInteractive, AudioStreamPlayer.get_playback_position() always returns 0 instead of returning the actual position. This is true for mp3 files and wav files, and probably other formats.
### Steps to reproduce
1. Create new project.
2. Create AudioStreamPlayer node.
3. Set AudioStreamPlayer's _stream_ to AudioStreamInteractive
4. Expand the AudioStreamInteractive in the inspector.
5. Add clip.
6. Import any audio file to the project.
8. Set Clip 0's _stream_ as the new audio file (drag the audio file over Clip 0's _stream_)
9. Attach a script to the AudioStreamPlayer node.
10. Replace function _process() with the following:
`func _process(delta: float) -> void:
print(get_playback_position())
`
11. Run project and see that the result is always 0.
### Minimal reproduction project (MRP)
In my MRP, I have included a 2-second mp3 of my own creation. I've set the mp3 to loop to demonstrate the bug clearly, but the bug also happens if the loop is disabled.
[audiostreaminteractive-bug-test.zip](https://github.com/user-attachments/files/17250681/audiostreaminteractive-bug-test.zip)
Amazing!!!
1 Like
qurage
October 5, 2024, 12:56am
5
Thank you! I’m looking forward to seeing it implemented!
1 Like