|
@@ -177,13 +177,10 @@ class HardwareDetectionController extends GetxController {
|
|
|
}
|
|
|
});
|
|
|
if (state.currentMicrophone == null) return;
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+ if (state.detectingMicrophone) {
|
|
|
+ await _stopRecordMicrophone();
|
|
|
+ _startRecordMicrophone();
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
|
|
@@ -297,6 +294,9 @@ class HardwareDetectionController extends GetxController {
|
|
|
return deviceList;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
_openSelectedCamera() {
|
|
|
bool found = false;
|
|
@@ -365,12 +365,22 @@ class HardwareDetectionController extends GetxController {
|
|
|
|
|
|
|
|
|
void _startRecordMicrophone() async {
|
|
|
+
|
|
|
+ if (state.currentMicrophone == null) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ final String fileNameWithMicrophoneId =
|
|
|
+ "${state.currentMicrophone!.id}.webm";
|
|
|
+
|
|
|
+
|
|
|
await flutterRecorder.startRecorder(
|
|
|
- toFile: _mPath, codec: _codec, audioSource: AudioSource.microphone);
|
|
|
+ toFile: fileNameWithMicrophoneId,
|
|
|
+ codec: _codec,
|
|
|
+ audioSource: AudioSource.microphone);
|
|
|
}
|
|
|
|
|
|
|
|
|
- void _stopRecordMicrophone() async {
|
|
|
+ Future<void> _stopRecordMicrophone() async {
|
|
|
await flutterRecorder.stopRecorder();
|
|
|
}
|
|
|
|