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

AudioStreamPlayer not paused on pause mode change #58543

Closed
Tracked by #76797
KoBeWi opened this issue Feb 25, 2022 · 3 comments
Closed
Tracked by #76797

AudioStreamPlayer not paused on pause mode change #58543

KoBeWi opened this issue Feb 25, 2022 · 3 comments

Comments

@KoBeWi
Copy link
Member

KoBeWi commented Feb 25, 2022

Godot version

3.x 0959ff2

System information

W10

Issue description

When you have AudioStreamPlayer and change its pause_mode, it will not get paused when it should.

Example code:
($AudioStreamPlayer has PAUSE_MODE_PROCESS)

func _ready() -> void:
	get_tree().paused = true
	$AudioStreamPlayer.play()
	yield(get_tree().create_timer(0.5), "timeout")
	$AudioStreamPlayer.pause_mode = Node.PAUSE_MODE_STOP # <- should stop playing here

Does not happen on master.

Steps to reproduce

  1. Add AudioStreamPlayer
  2. Add any long enough sound
  3. Set pause_mode to Process
  4. Add a script with the above code
  5. Run and observe the player not pausing

Minimal reproduction project

No response

@pfertyk
Copy link
Contributor

pfertyk commented Feb 26, 2022

I'd like to submit a solution. It seems that, even though we save the new pause_mode, we don't send any notifications about it. I also added a check for can_process when unpausing AudioStreamPlayer (similar as pausing).

I tried to keep the code changes to minimum. This solution works for both cases (process => stop and stop => process), but I haven't check all combinations :) It's possible that we could use a new method here, like propagate_pause_mode. If so, let me know :)

@Reapetitive
Copy link

Reapetitive commented Oct 3, 2022

What is even worse, the sounds sometimes do not unpause! The stream_paused stays true, after unpausing.

@lawnjelly lawnjelly modified the milestones: 3.5, 3.x Feb 12, 2023
pfertyk added a commit to pfertyk/godot that referenced this issue Apr 5, 2024
@lawnjelly
Copy link
Member

Fixed by #58577.

@akien-mga akien-mga modified the milestones: 3.x, 3.6 Jun 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants