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

negative interaction with flutter_soloud #138

Open
lukepighetti opened this issue Jul 9, 2024 · 1 comment
Open

negative interaction with flutter_soloud #138

lukepighetti opened this issue Jul 9, 2024 · 1 comment

Comments

@lukepighetti
Copy link

lukepighetti commented Jul 9, 2024

When calling .setActive(false) I get an error PlatformException(560030580, Session deactivation failed, null, null) after flutter_soloud has loaded an asset

final _session = await AudioSession.instance;
await _session.configure(const AudioSessionConfiguration.music());

final _soloud = SoLoud.instance;
await _soloud.init();

await _session.setActive(true); // completes as expected
final _ = await _soloud.loadAsset("tone.wav"); // commenting this out resolves the issue
await _session.setActive(false); // PlatformException(560030580, Session deactivation failed, null, null)
dependencies:
  audio_session: ^0.1.19
  flutter_soloud: ^2.0.2
Flutter (Channel stable, 3.22.2, on macOS 14.4.1 23E224 darwin-arm64, locale en-US)
---
[✓] Xcode - develop for iOS and macOS (Xcode 15.3)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 15E204a
    • CocoaPods version 1.15.2
---
[✓] Connected device (4 available)
    • Luke's iPhone (mobile)          • 0bcxxxxxxxx • ios
      • iOS 16.7.8 20H343
@lukepighetti lukepighetti changed the title PlatformException(560030580, Session deactivation failed, null, null) negative interaction with flutter_soloud Jul 9, 2024
@ryanheise
Copy link
Owner

Hi @lukepighetti

This package merely wraps the raw API calls, in this case to AVAudioSession.setActive, and so you would need to consult Apple's documentation to understand the API response. According to the documentation, the code 560030580 corresponds to the message "AVAudioSessionErrorCodeIsBusy".

For more information, see:

https://developer.apple.com/documentation/avfaudio/avaudiosession/1616597-setactive

The session fails to activate if another audio session has higher priority than yours (such as a phone call) and neither audio session allows mixing. Deactivating an audio session with running audio objects stops the objects, makes the session inactive, and returns an AVAudioSessionErrorCodeIsBusy error.

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

No branches or pull requests

2 participants