You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
AudioStreamPlayer changes the stream_paused property internally when NOTIFICATION_PAUSED and NOTIFICATION_UNPAUSED is being propagated. While it seems to be desired behaviour to pause the AudioStreamPlayer if the pause_mode doesn't allow it to process further if the SceneTree is paused, the information if it was paused before the SceneTree was paused is lost. This way you cannot revert to the previous value after the SceneTree is unpaused again (Currently stream_paused is always set to false).
if (p_what == NOTIFICATION_PAUSED) {
if (!can_process()) {
// Node can't process so we start fading out to silence
set_stream_paused(true);
}
}
if (p_what == NOTIFICATION_UNPAUSED) {
set_stream_paused(false);
}
audio_stream_player.cpp
(I wasn't able to find out how to quote the actual code)
This makes setting the stream_paused property manually very unreliable to use if you also want to pause your game and you are left with no good option to pause a AudioStreamPlayer temporarily.
Steps to reproduce
Create a new project
Add a AudioStreamPlayer to your scene
Call play() and set stream_paused to true
Pause the SceneTree with get_tree().paused = true
Unpause the SceneTree with get_tree().paused = false
stream_paused will be set to false again
Minimal reproduction project
No response
The text was updated successfully, but these errors were encountered:
It is actually intentional, and is still present in the alpha builds, but to quote myself:
This, from the user's perspective, makes setting the stream_paused property manually a bit more unreliable than it already was before. Maybe something about it can be done another time?
The reason for this is, as you have noticed, is because stream_paused is used internally by the engine for those kind of occasions described above.
There should probably be two variables handling this. One of them is internal, the other (stream_paused) is exposed to the user.
Godot version
3.5.stable
System information
Windows 10
Issue description
AudioStreamPlayer
changes thestream_paused
property internally whenNOTIFICATION_PAUSED
andNOTIFICATION_UNPAUSED
is being propagated. While it seems to be desired behaviour to pause theAudioStreamPlayer
if thepause_mode
doesn't allow it to process further if the SceneTree is paused, the information if it was paused before the SceneTree was paused is lost. This way you cannot revert to the previous value after the SceneTree is unpaused again (Currentlystream_paused
is always set to false).audio_stream_player.cpp
(I wasn't able to find out how to quote the actual code)
This makes setting the
stream_paused
property manually very unreliable to use if you also want to pause your game and you are left with no good option to pause aAudioStreamPlayer
temporarily.Steps to reproduce
AudioStreamPlayer
to your sceneplay()
and setstream_paused
to trueget_tree().paused = true
get_tree().paused = false
stream_paused
will be set to false againMinimal reproduction project
No response
The text was updated successfully, but these errors were encountered: