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
See how in the Integration Demo sample packaged with the Wwise SDK the engine is put to a suspended state in response to window minimize and restore: the platform-specific WM handlers call IntegrationDemo::Pause and IntegrationDemo::Resume, which respectively call AK::SoundEngine::Suspend(false) and AK::SoundEngine::WakeupFromSuspend().
This can be accompanied by posting a pause all and resume all event, but this is typically left to the client (because events are project specific).
At the moment, I don't see any window minimized or restored NOTIFICATION_WM_* constant in Godot 4.1 (looking here: https://docs.godotengine.org/en/stable/classes/class_node.html#constants).
At least, NOTIFICATION_APPLICATION_PAUSED and NOTIFICATION_APPLICATION_RESUMED would apply to Android, but suspending on focus out might prove too constraining.
Steps to reproduce
Minimize or restore a window: see that the sound keeps playing.
Minimal reproduction project
N/A
The text was updated successfully, but these errors were encountered:
I've explored this during the update to Godot 4.2, which finally allowed the addition of Android support, enabling me to test its behavior on that platform.
I also observed that the focus in/out behavior is quite restrictive, particularly when connected to and interacting with the authoring app.
For desktop platforms, I've introduced a suspend_on_focus_loss setting that users can activate in the Project Settings. When activated, NOTIFICATION_APPLICATION_FOCUS_OUT and NOTIFICATION_APPLICATION_FOCUS_IN will trigger calls to AK::SoundEngine::Suspend and AK::SoundEngine::WakeupFromSuspend, respectively.
This setting provides the option to customize the suspend behavior in the editor for both debug and release builds.
If deactivated, users still have the possibility to control the behavior themselves, either by calling suspend and wakeup_from_suspend in the Wwise singleton, or by calling pause and resume in the WwiseRuntimeManager.
On Android, the suspend and wakeup functions will be called by default on NOTIFICATION_APPLICATION_PAUSED and NOTIFICATION_APPLICATION_UNPAUSED (currently only implemented on Android).
When looking at Godot's windows display server, I can't find any notification handling for window minimize and restore. This is something I can investigate with the Godot community in the future.
focus in/out behavior is quite restrictive, particularly when connected to and interacting with the authoring app.
Definitely agree here: it's a lot less useful to bind this on focus instead of minimize-restore state, but without the notification I understand that's the best you can do. It doesn't look too hard to add it in Godot, hopefully this is something that gets added eventually!
Wwise integration version
wwise-2023.1.0-beta-for-godot-4.1.1-stable-2.0.2
System information
Any
Issue description
See how in the Integration Demo sample packaged with the Wwise SDK the engine is put to a suspended state in response to window minimize and restore: the platform-specific WM handlers call
IntegrationDemo::Pause
andIntegrationDemo::Resume
, which respectively callAK::SoundEngine::Suspend(false)
andAK::SoundEngine::WakeupFromSuspend()
.This can be accompanied by posting a pause all and resume all event, but this is typically left to the client (because events are project specific).
At the moment, I don't see any window minimized or restored NOTIFICATION_WM_* constant in Godot 4.1 (looking here: https://docs.godotengine.org/en/stable/classes/class_node.html#constants).
At least, NOTIFICATION_APPLICATION_PAUSED and NOTIFICATION_APPLICATION_RESUMED would apply to Android, but suspending on focus out might prove too constraining.
Steps to reproduce
Minimize or restore a window: see that the sound keeps playing.
Minimal reproduction project
N/A
The text was updated successfully, but these errors were encountered: