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

"audio_streamer" crashes after play audio and try to listen again to the mic #91

Closed
JPiris88 opened this issue May 18, 2020 · 3 comments

Comments

@JPiris88
Copy link
Contributor

JPiris88 commented May 18, 2020

Plugin name & version
noise_meter 1.2.0 uses audio_streamer 1.1.5

Describe the bug
After play an audio with an audio player plugin like "assets_audio_player" or "audioplayers" and try to call "_noiseMeter.noiseStream.listen(onData);", the app crashes.

If I play no audio, starting and stopping noise_meter works well.

To Reproduce

  1. Play an audio with "assets_audio_player" or "audioplayers"
  2. Start listening the mic with noise_meter/audio_streamer

Expected behavior
Listening the mic after playing an audio should work well

Actual behavior
I've run the app also in XCode and fails in SwiftAudioStreamerPlugin class, in "try! engine.start()" line.

https://github.com/cph-cachet/flutter-plugins/blob/master/packages/audio_streamer/ios/Classes/SwiftAudioStreamerPlugin.swift

12:36:15.277 ERROR: [0x392f0000] >aurioc> 807: failed: -10851 (enable 1, outf< 2 ch, 0 Hz, Float32, non-inter> inf< 2 ch, 0 Hz, Float32, non-inter>)
12:36:15.281 ERROR: [0x392f0000] >aurioc> 807: failed: -10851 (enable 1, outf< 2 ch, 0 Hz, Float32, non-inter> inf< 2 ch, 0 Hz, Float32, non-inter>)
12:36:15.283 ERROR: [0x392f0000] >aurioc> 807: failed: -10851 (enable 1, outf< 2 ch, 0 Hz, Float32, non-inter> inf< 2 ch, 0 Hz, Float32, non-inter>)
12:36:15.284 ERROR: [0x392f0000] AVAudioEngineGraph.mm:2510: PerformCommand: error -10851
*** Terminating app due to uncaught exception 'com.apple.coreaudio.avfaudio', reason: 'error -10851'
*** First throw call stack:
(0x2223b91b 0x219d6e17 0x2223b7f1 0x27acefc1 0x27ae22c5 0x27aeafa1 0x27aec189 0x27adf1f9 0x27adffc5 0x27ae0fbb 0x27ae3141 0x27b1fd43 0x27b1ec5f 0x27b1ebd3 0x1da642d 0x1da5edb 0x1da5f87 0x264527 0x2125bb 0x25878d 0x21f881 0x22122f 0x221fe58f 0x221fe1c1 0x221fc00d 0x2214b229 0x2214b015 0x2373bac9 0x2681f189 0xc0f6d 0x21df3873)

Flutter doctor
[✓] Flutter (Channel stable, v1.12.13+hotfix.9, on Mac OS X 10.14.5 18F132, locale es-ES)

[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
[✓] Xcode - develop for iOS and macOS (Xcode 11.0)
[✓] Android Studio (version 3.6)
[✓] Connected device (1 available)

Smartphone(s) / Emulator

  • Device: iPad MC983TY/A
  • OS: iOS 9.3.5 (13G36)

Additional context
Maybe the iOS audio session must be in "AVAudioSessionCategoryRecord" every time starts listening the mic?

@JPiris88
Copy link
Contributor Author

I have open a pull request fixing this issue, it's working fine in my app.

Can you test and merge it please?

@Christophe567
Copy link

Worked for me as well. Many thanks.

@thomasnilsson
Copy link
Contributor

thomasnilsson commented Jul 13, 2020

Thank you! I have merged it now, and it is available in version 1.2.0 :)

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

3 participants