Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AudioStreamPlayback method _stop() is not called when AudioStreamPlayer.stop() is called #97466

Closed
fediazc opened this issue Sep 25, 2024 · 3 comments · Fixed by #97625
Closed

Comments

@fediazc
Copy link

fediazc commented Sep 25, 2024

Tested versions

4.2.2.stable, 4.3.stable, 4.4.dev2

System information

Godot v4.3.stable - Windows 10.0.19045

Issue description

When calling AudioStreamPlayer.stop(), the corresponding AudioStreamPlayback's _stop() method is not called. The documentation for AudioStreamPlayback._stop() says it should get called in this case.

Steps to reproduce

  1. Create a script that extends AudioStreamPlayback, and override the _start() and _stop() methods.
  2. Create script that extends AudioStream and a corresponding AudioStream resource that uses this script. Override the AudioStream._instantiate_playback() method, and return a reference to an AudioStreamPlayback child object from the previous step.
  3. Create a new scene with an AudioStreamPlayer node. Set its stream property to the AudioStream resource from the previous step. Add a script to the node and call the play() method, followed by a call to the stop() method. Run the project and note that AudioStreamPlayback._stop() is not called.

Minimal reproduction project (MRP)

playback-stop-mrp.zip

When you run the project, observe that the print statement in AudioStreamPlaybackChild._stop() is not executed.

@SourceOfHTML
Copy link
Contributor

SourceOfHTML commented Sep 28, 2024

Working on this right now, so far all I've got is information, nothing actionable yet, although I'll keep it updated.

@SourceOfHTML
Copy link
Contributor

This problem got hands.

What I've got is that the source thinks that _instantiate_playback() isn't defined. Why it still calls play and not stop, I have yet to figure out.

@SourceOfHTML
Copy link
Contributor

Adding a single line into AudioServer::stop_playback_stream(p_playback) seems to have fixed the issue, though to avoid possibly breaking other things, I'm not gonna PR it yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants