Skip to content

Conversation

@raggy
Copy link

@raggy raggy commented Nov 10, 2025

Addresses #401

@CedNaru
Copy link
Member

CedNaru commented Nov 12, 2025

Is there a reason why it's for iOS only and not enable for Android ?
That notification only exist for those 2 platforms, Android is likely to have the same issue.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for calling FMOD's mixerSuspend and mixerResume functions when an iOS application moves to/from the background, addressing issue #401.

  • Exposes two new methods mixer_suspend() and mixer_resume() in the FmodServer C++ API
  • Integrates these methods into the GDScript bindings for use in Godot
  • Implements automatic suspension/resumption in the demo FmodManager when the iOS app loses/gains focus

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/fmod_server.h Adds public method declarations for mixer_suspend() and mixer_resume()
src/fmod_server.cpp Implements the new methods as wrappers around FMOD's core system mixer functions and registers them with Godot's class binding system
demo/addons/fmod/FmodManager.gd Calls the new mixer methods in response to iOS application focus notifications to properly suspend/resume audio when backgrounded

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

func _notification(what):
FmodServer.notification(what)

if OS.has_feature("ios"):
Copy link

Copilot AI Nov 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to FMOD documentation, mixerSuspend() and mixerResume() should be called when the app goes to the background on mobile platforms, not just iOS. Consider also handling Android by checking for OS.has_feature("android") in addition to iOS. This would ensure proper audio handling when the app is backgrounded on all mobile platforms.

Suggested change
if OS.has_feature("ios"):
if OS.has_feature("ios") or OS.has_feature("android"):

Copilot uses AI. Check for mistakes.
@raggy
Copy link
Author

raggy commented Nov 12, 2025

Is there a reason why it's for iOS only and not enable for Android ? That notification only exist for those 2 platforms, Android is likely to have the same issue.

We weren't finding any issues with Android sound not returning, but I agree that this solution would be totally fine for Android too. On Android I believe the sound just continues in the background unless you choose to mute it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants