flutter_sound: [HELP] I cannot capture the audio from the bluetooth microphone [iOS]
I need Help for : To record audio using a bluetooth microphone
-
Using the API ? Flutter_Sound 5.1.1 (Full)
-
Generate an iOS or Android App ? iOS (iPhone6s, iOS: 13.5.1) Android
Here is my question :
Hi,
I downloaded “flutter_sound” 5.1.1 and adjust the code in “demo1.dart” to change to “bluetootha2dp”
recorderModule.setAudioFocus(device: AudioDevice.blueToothA2DP); // added
await recorderModule.startRecorder(
toFile: path,
codec: _codec,
bitRate: 8000,
sampleRate: 8000,
);
print('startRecorder');
However, it does not work. It still capture the voice from the embedded microphone.
Then, I tried to OpenAudioSession
Future<void> init() async {
//playerModule = await FlutterSoundPlayer().openAudioSession();
recorderModule.openAudioSession(
focus: AudioFocus.requestFocusTransient,
category: SessionCategory.playAndRecord,
mode: SessionMode.modeDefault,
audioFlags: allowBlueToothA2DP, // adjusted
device: AudioDevice.blueToothA2DP // adjusted
);
await _initializeExample(false);
if (Platform.isAndroid) {
copyAssets();
}
}
Still, it does not work.
Is there anything I missed? If anyone could guide me or provide a source code, would be very appreciated.
Sorry that I am totally new to Flutter and iOS.
Regards, Krit
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 26
@Kashif-Asghar60 Could you share please your code with me also? Struggling to get Bluetooth mic recording working in Flutter. correo.aog@gmail.com
I had great luck with this in my audio session initialization code using
audio_session:To me as well please, aryan.one0793@gmail.com
Check your email for the file; I’ve just sent it.
I used the native approach with kotlin and it worked , Hats-off to zahid for sharing the kotlin code.