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

[BUG]: Crash when recording while using Bluetooth headphones (iOS) #880

Closed
ericadu opened this issue Apr 18, 2022 · 12 comments
Closed

[BUG]: Crash when recording while using Bluetooth headphones (iOS) #880

ericadu opened this issue Apr 18, 2022 · 12 comments

Comments

@ericadu
Copy link

ericadu commented Apr 18, 2022

Flutter Sound Version :

  • FULL or LITE flavor ? Full

  • Important: Result of the command : flutter pub deps | grep flutter_sound

➜  app git:(main) ✗ flutter pub deps | grep flutter_sound
|-- flutter_sound 9.1.9
|   |-- flutter_sound_platform_interface 9.1.9
|   |-- flutter_sound_web 9.1.9
|   |   |-- flutter_sound_platform_interface...

Severity

**[ x ] CRASH **

  • Result is not what expected ?

  • Cannot build my App ?

  • Minor issue ?


Platforms you faced the error

**[ x ] iOS **

  • Android ?

  • Flutter Web ?

  • Emulator ?

**[ x ] REAL DEVICE **


Describe the bug
A clear and concise description of what the bug is.

We record audio when a user taps a microphone button. However, when a user is connected to a bluetooth speaker, the app crashes after they tap the microphone.

To Reproduce
Steps to reproduce the behavior:

  1. Connect to bluetooth headphones (outside of app)
  2. In app, tap microphone button, which starts FlutterRecorder session recording to stream
  3. App crashes after 1-2 seconds of recording.

Logs!!!!

(This is very important. Most of the time we cannot do anything if we do not have information on your bug).
To activate the logs, you must instantiate your modules with the Log Level set to Level.debug :

FlutterSoundPlayer myPlayer = FlutterSoundPlayer(logLevel: Level.debug);
FlutterSoundRecorder myRecorder = FlutterSoundRecorder(logLevel: Level.debug);

See this


flutter: ┌───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
flutter: │ #0   new FlutterSoundRecorder (package:flutter_sound/public/flutter_sound_recorder.dart:140:13)
flutter: │ #1   new _RecordButtonBarRealtimeState (package:app/screens/chat_detail/record/record_button_realtime.dart:65:7)
flutter: ├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄
flutter: │ 🐛 ctor: FlutterSoundRecorder()
flutter: └───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
flutter: ┌───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
flutter: │ #0   FlutterSoundRecorder.openRecorder (package:flutter_sound/public/flutter_sound_recorder.dart:372:13)
flutter: │ #1   _RecordButtonBarRealtimeState.initState (package:app/screens/chat_detail/record/record_button_realtime.dart:132:19)
flutter: ├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄
flutter: │ 🐛 FS:---> openAudioSession
flutter: └───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
flutter: ┌───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
flutter: │ #0   FlutterSoundRecorder._openAudioSession (package:flutter_sound/public/flutter_sound_recorder.dart:381:13)
flutter: │ #1   FlutterSoundRecorder.openRecorder.<anonymous closure> (package:flutter_sound/public/flutter_sound_recorder.dart:374:17)
flutter: ├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄
flutter: │ 🐛 ---> openAudioSession
flutter: └───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
flutter: ┌───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
flutter: │ #0   FlutterSoundRecorder.openRecorderCompleted (package:flutter_sound/public/flutter_sound_recorder.dart:171:13)
flutter: │ #1   MethodChannelFlutterSoundRecorder.channelMethodCallHandler (package:flutter_sound_platform_interface/method_channel_flutter_sound_recorder.dart:98:22)
flutter: ├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄
flutter: │ 🐛 ---> openRecorderCompleted: true
flutter: └───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
flutter: ┌───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
flutter: │ #0   FlutterSoundRecorder.openRecorderCompleted (package:flutter_sound/public/flutter_sound_recorder.dart:182:13)
flutter: │ #1   MethodChannelFlutterSoundRecorder.channelMethodCallHandler (package:flutter_sound_platform_interface/method_channel_flutter_sound_recorder.dart:98:22)
flutter: ├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄
flutter: │ 🐛 <--- openRecorderCompleted: true
flutter: └───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
flutter: ┌───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
flutter: │ #0   FlutterSoundRecorder._openAudioSession (package:flutter_sound/public/flutter_sound_recorder.dart:412:13)
flutter: │ #1   <asynchronous suspension>
flutter: ├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄
flutter: │ 🐛 <--- openAudioSession
flutter: └───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
flutter: ┌───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
flutter: │ #0   FlutterSoundRecorder.openRecorder (package:flutter_sound/public/flutter_sound_recorder.dart:376:13)
flutter: │ #1   <asynchronous suspension>
flutter: ├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄
flutter: │ 🐛 FS:<--- openAudioSession
flutter: └───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
flutter: PLAYING
flutter: ┌───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
flutter: │ #0   FlutterSoundRecorder.startRecorder (package:flutter_sound/public/flutter_sound_recorder.dart:590:13)
flutter: │ #1   _RecordButtonBarRealtimeState._record (package:app/screens/chat_detail/record/record_button_realtime.dart:266:12)
flutter: ├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄
flutter: │ 🐛 FS:---> startRecorder
flutter: └───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
flutter: ┌───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
flutter: │ #0   FlutterSoundRecorder._startRecorder (package:flutter_sound/public/flutter_sound_recorder.dart:614:13)
flutter: │ #1   FlutterSoundRecorder.startRecorder.<anonymous closure> (package:flutter_sound/public/flutter_sound_recorder.dart:592:13)
flutter: ├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄
flutter: │ 🐛 FS:---> _startRecorder.
flutter: └───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
flutter: ┌───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
flutter: │ #0   FlutterSoundRecorder.startRecorderCompleted (package:flutter_sound/public/flutter_sound_recorder.dart:234:13)
flutter: │ #1   MethodChannelFlutterSoundRecorder.channelMethodCallHandler (package:flutter_sound_platform_interface/method_channel_flutter_sound_recorder.dart:74:22)
flutter: ├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄
flutter: │ 🐛 ---> startRecorderCompleted: true
flutter: └───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
flutter: ┌───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
flutter: │ #0   FlutterSoundRecorder.startRecorderCompleted (package:flutter_sound/public/flutter_sound_recorder.dart:243:13)
flutter: │ #1   MethodChannelFlutterSoundRecorder.channelMethodCallHandler (package:flutter_sound_platform_interface/method_channel_flutter_sound_recorder.dart:74:22)
flutter: ├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄
flutter: │ 🐛 <--- startRecorderCompleted: true
flutter: └───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
flutter: ┌───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
flutter: │ #0   FlutterSoundRecorder._startRecorder (package:flutter_sound/public/flutter_sound_recorder.dart:689:13)
flutter: │ #1   <asynchronous suspension>
flutter: ├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄
flutter: │ 🐛 FS:<--- _startRecorder.
flutter: └───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
flutter: ┌───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
flutter: │ #0   FlutterSoundRecorder.startRecorder (package:flutter_sound/public/flutter_sound_recorder.dart:602:13)
flutter: │ #1   <asynchronous suspension>
flutter: ├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄
flutter: │ 🐛 FS:<--- startRecorder
flutter: └───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[3]'
*** First throw call stack:
(0x18086b70c 0x197fa6f04 0x180965984 0x18096fb1c 0x18082ad28 0x1808483e4 0x100a8a9ec 0x102aeb49c 0x102aec77c 0x1dce384d4 0x1dcdf2470 0x1dce373e4 0x18052c094 0x1804cebb4 0x1804e08d8 0x1804d260c 0x1804d3220 0x1804d4394 0x1804dcec4 0x1db95fe10 0x1db95f93c)
libc++abi: terminating with uncaught exception of type NSException
* thread #40, queue = 'RealtimeMessenger.mServiceQueue', stop reason = signal SIGABRT
    frame #0: 0x00000001bafb9bbc libsystem_kernel.dylib`__pthread_kill + 8
libsystem_kernel.dylib`__pthread_kill:
->  0x1bafb9bbc <+8>:  b.lo   0x1bafb9bd8               ; <+36>
    0x1bafb9bc0 <+12>: stp    x29, x30, [sp, #-0x10]!
    0x1bafb9bc4 <+16>: mov    x29, sp
    0x1bafb9bc8 <+20>: bl     0x1bafb560c               ; cerror_nocancel
Target 0: (Runner) stopped.
Lost connection to device.
@ericadu ericadu changed the title [BUG]: Crash when recording and using Bluetooth headpones [BUG]: Crash when recording and using Bluetooth headphones (iOS) Apr 18, 2022
@ericadu ericadu changed the title [BUG]: Crash when recording and using Bluetooth headphones (iOS) [BUG]: Crash when recording while using Bluetooth headphones (iOS) Apr 18, 2022
@ericadu
Copy link
Author

ericadu commented Apr 18, 2022

Seems to be an error in FlautoRecorderEngine.mm. Here's some more logs from Crashlytics:

Fatal Exception: NSInvalidArgumentException
0  CoreFoundation                 0x11b928 __exceptionPreprocess
1  libobjc.A.dylib                0x26480 objc_exception_throw
2  CoreFoundation                 0x187698 -[__NSCFString characterAtIndex:].cold.1
3  CoreFoundation                 0x1927d8 -[__NSPlaceholderDictionary initWithCapacity:].cold.1
4  CoreFoundation                 0x154a8 -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]
5  CoreFoundation                 0x87f8 +[NSDictionary dictionaryWithObjects:forKeys:count:]
6  Runner                         0x422354 -[Session log:msg:] + 119 (FlutterSoundManager.m:119)
7  flutter_sound_core             0x82a0 -[FlautoRecorder logDebug:] + 267 (FlautoRecorder.mm:267)
8  flutter_sound_core             0x8eb8 invocation function for block in AudioRecorderEngine::AudioRecorderEngine(t_CODEC, NSString*, NSMutableDictionary*, FlautoRecorder*) + 100 (FlautoRecorderEngine.mm:100)
9  AVFAudio                       0x3a434 AVAudioNodeTap::TapMessage::RealtimeMessenger_Perform()
10 AVFAudio                       0xd8054 RealtimeMessenger::_PerformPendingMessages()
11 AVFAudio                       0xd7fe4 invocation function for block in RealtimeMessenger::RealtimeMessenger(applesauce::dispatch::v1::queue)
12 libdispatch.dylib              0x61298 _dispatch_client_callout
13 libdispatch.dylib              0x6028 _dispatch_continuation_pop$VARIANT$mp
14 libdispatch.dylib              0x16d64 _dispatch_source_invoke$VARIANT$mp
15 libdispatch.dylib              0x9908 _dispatch_lane_serial_drain$VARIANT$mp
16 libdispatch.dylib              0xa548 _dispatch_lane_invoke$VARIANT$mp
17 libdispatch.dylib              0xb67c _dispatch_workloop_invoke$VARIANT$mp
18 libdispatch.dylib              0x13fac _dispatch_workloop_worker_thread
19 libsystem_pthread.dylib        0xb5bc (Missing UUID c97218d95a4c3191b30d4c275080fc8f)
20 libsystem_pthread.dylib        0xe86c (Missing UUID c97218d95a4c3191b30d4c275080fc8f)```

@ericadu
Copy link
Author

ericadu commented Apr 18, 2022

Do we think this could be related? https://stackoverflow.com/questions/53351976/changing-audio-input-source-with-avaudiosession-causes-crash

We do have code that sets audio configs to allow bluetooth and default to speaker. This is set before a user records anything.

import 'package:audio_session/audio_session.dart';

class AudioSessionService {
  Future<void> initSession() async {
    final session = await AudioSession.instance;
    await session.configure(AudioSessionConfiguration(
      avAudioSessionCategory: AVAudioSessionCategory.playAndRecord,
      avAudioSessionCategoryOptions:
          AVAudioSessionCategoryOptions.allowBluetooth |
              AVAudioSessionCategoryOptions.defaultToSpeaker,
      avAudioSessionMode: AVAudioSessionMode.spokenAudio,
      avAudioSessionRouteSharingPolicy:
          AVAudioSessionRouteSharingPolicy.defaultPolicy,
      avAudioSessionSetActiveOptions: AVAudioSessionSetActiveOptions.none,
      androidAudioAttributes: const AndroidAudioAttributes(
        contentType: AndroidAudioContentType.speech,
        flags: AndroidAudioFlags.none,
        usage: AndroidAudioUsage.voiceCommunication,
      ),
      androidAudioFocusGainType: AndroidAudioFocusGainType.gain,
      androidWillPauseWhenDucked: true,
    ));
  }
}

@Larpoux
Copy link
Collaborator

Larpoux commented Apr 19, 2022

Hi Erica.
Your issue is correctly filled : I have enough information to work on it.
I am going to look to your issue. I will post you something at the end of the afternoon.

@ericadu
Copy link
Author

ericadu commented Apr 19, 2022

Thank you @Larpoux ! I appreciate your speed on this issue 🙏🏼

@Larpoux
Copy link
Collaborator

Larpoux commented Apr 19, 2022

@ericadu ,
Erica : could you try Flutter Sound 9.2.9, please. I fixed a bug when we try to LogDebug() a NIL value.

@ericadu
Copy link
Author

ericadu commented Apr 19, 2022

It no longer crashes -- exciting! Thank you so much ☺️.

However, it looks like perhaps the underlying issue is that I'm not recording anything when using Bluetooth. Are you seeing this as well?

Error Domain=NSCocoaErrorDomain Code=3840 "Unable to parse empty data." UserInfo={NSDebugDescription=Unable to parse empty data.}

@ericadu
Copy link
Author

ericadu commented Apr 19, 2022

Update! Tried with another Bluetooth headset and it works great. Was just that individual headset.

Thanks again @Larpoux for such a speedy fix -- greatly appreciate it!

@Larpoux
Copy link
Collaborator

Larpoux commented Apr 19, 2022

👍

@ericadu ericadu closed this as completed Apr 20, 2022
@ericadu
Copy link
Author

ericadu commented Apr 23, 2022

@Larpoux I'm seeing crashes in prod in the audio player now (play from stream) and I'm wondering if it's related. I'm seeing this in my local dev:

-[NSError init] called; this results in an invalid NSError instance. It will raise an exception in a future release. Please call errorWithDomain:code:userInfo: or initWithDomain:code:userInfo:. This message shown only once.

and also seeing this in the crash stack:

 Fatal Exception: com.apple.coreaudio.avfaudio
required condition is false: IsFormatSampleRateAndChannelCountValid(format)
Fatal Exception: com.apple.coreaudio.avfaudio
0  CoreFoundation                 0x99d78 __exceptionPreprocess
1  libobjc.A.dylib                0x16734 objc_exception_throw
2  CoreFoundation                 0x171050 -[NSException initWithCoder:]
3  AVFAudio                       0x9f1c AVAE_RaiseException(NSString*, ...)
4  AVFAudio                       0x556ec AVAudioEngineGraph::_Connect(AVAudioNodeImplBase*, AVAudioNodeImplBase*, unsigned int, unsigned int, AVAudioFormat*)
5  AVFAudio                       0x5cc94 AVAudioEngineGraph::Connect(AVAudioNode*, AVAudioNode*, unsigned long, unsigned long, AVAudioFormat*)
6  AVFAudio                       0xdf1a8 AVAudioEngineImpl::Connect(AVAudioNode*, AVAudioNode*, unsigned long, unsigned long, AVAudioFormat*)
7  AVFAudio                       0xe0fc8 -[AVAudioEngine connect:to:format:]
8  flutter_sound_core             0x650c -[AudioEngine init:] + 195 (FlautoPlayerEngine.mm:195)
9  flutter_sound_core             0x4b84 -[FlautoPlayer startPlayerCodec:fromURI:fromDataBuffer:channels:sampleRate:] + 188 (FlautoPlayer.mm:188)
10 Runner                         0x43d6b4 -[FlutterSoundPlayer startPlayer:result:] + 222 (FlutterSoundPlayer.mm:222)
11 Runner                         0x43ea30 -[FlutterSoundPlayerManager handleMethodCall:result:] + 109 (FlutterSoundPlayerManager.mm:109)

@ericadu ericadu reopened this Apr 23, 2022
@Larpoux
Copy link
Collaborator

Larpoux commented Apr 23, 2022

What is the sample rate that you specified?
What is the number of channels that you specified?

@ericadu
Copy link
Author

ericadu commented Apr 23, 2022

Here is the exact call:

      _mRecorder!
          .startRecorder(
        toStream: recordingDataController.sink,
        codec: Codec.pcm16,
        numChannels: 1,
      )

Using defaults for the others, so

numChannels = 1
sampleRate = 16000
bitRate = 16000

@ericadu
Copy link
Author

ericadu commented May 2, 2022

Ok, after some more investigation, I believe there is still an issue related to recording with Bluetooth, but different from this thread. Will file a different issue here and in audio_sessions, and close this for now.

Thanks!

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

No branches or pull requests

2 participants