|
|
|
@ -90,7 +90,7 @@ class MeetingRecordController extends GetxController |
|
|
|
Future<void> _reinitializeAsrService() async { |
|
|
|
try { |
|
|
|
// 重新初始化ASR服务 |
|
|
|
await _asrService.initialize(); |
|
|
|
// await _asrService.initialize(); |
|
|
|
|
|
|
|
Logger.info('ASR服务重新初始化成功'); |
|
|
|
} catch (e) { |
|
|
|
@ -163,7 +163,7 @@ class MeetingRecordController extends GetxController |
|
|
|
_bleManager.closeCodec(); |
|
|
|
} |
|
|
|
_asrService.stopRecord(true); |
|
|
|
_asrService.stopContinuousRecognition(); |
|
|
|
//_asrService.stopContinuousRecognition(); |
|
|
|
isRecording.value = false; |
|
|
|
} |
|
|
|
|
|
|
|
@ -196,12 +196,12 @@ class MeetingRecordController extends GetxController |
|
|
|
|
|
|
|
/// Toggles visibility of transcribed text content |
|
|
|
Future<void> toggleTextDisplay() async { |
|
|
|
final recognitionStream = await _asrService.recognizeCallback(); |
|
|
|
_recognitionSubscription?.cancel(); |
|
|
|
_recognitionSubscription = |
|
|
|
recognitionStream.listen(_handleRecognitionEvent); |
|
|
|
// final recognitionStream = await _asrService.recognizeCallback(); |
|
|
|
// _recognitionSubscription?.cancel(); |
|
|
|
// _recognitionSubscription = |
|
|
|
// recognitionStream.listen(_handleRecognitionEvent); |
|
|
|
|
|
|
|
await _asrService.startContinuousRecognition(_audioSourceType); |
|
|
|
//await _asrService.startContinuousRecognition(_audioSourceType); |
|
|
|
showTextContent.toggle(); |
|
|
|
} |
|
|
|
|
|
|
|
@ -242,8 +242,8 @@ class MeetingRecordController extends GetxController |
|
|
|
/// Starts recording session |
|
|
|
Future<void> _startRecording() async { |
|
|
|
// Initialize speech recognition |
|
|
|
final recognitionStream = |
|
|
|
await _asrService.startContinuousRecognition(_audioSourceType); |
|
|
|
// final recognitionStream = |
|
|
|
// await _asrService.startContinuousRecognition(_audioSourceType); |
|
|
|
|
|
|
|
// Prepare storage directory |
|
|
|
final appDir = await appDocDir; |
|
|
|
@ -284,14 +284,14 @@ class MeetingRecordController extends GetxController |
|
|
|
|
|
|
|
/// Pauses current recording session |
|
|
|
Future<void> _pauseRecording() async { |
|
|
|
await _asrService.stopContinuousRecognition(); |
|
|
|
// await _asrService.stopContinuousRecognition(); |
|
|
|
await _asrService.pauseRecord(); |
|
|
|
pauseTimer(); |
|
|
|
} |
|
|
|
|
|
|
|
/// Resumes paused recording session |
|
|
|
Future<void> _resumeRecording() async { |
|
|
|
await _asrService.startContinuousRecognition(_audioSourceType); |
|
|
|
//await _asrService.startContinuousRecognition(_audioSourceType); |
|
|
|
|
|
|
|
startTimer(); |
|
|
|
} |
|
|
|
@ -303,6 +303,7 @@ class MeetingRecordController extends GetxController |
|
|
|
intermediateContent.value = event.text; |
|
|
|
break; |
|
|
|
case RecognitionEventType.onAudio: |
|
|
|
print("音波数据:${event.audio!.length}"); |
|
|
|
// 添加新音频数据到波形 |
|
|
|
_processAudioData(event.audio!); |
|
|
|
break; |
|
|
|
@ -461,7 +462,7 @@ class MeetingRecordController extends GetxController |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
await _asrService.stopContinuousRecognition(); |
|
|
|
//await _asrService.stopContinuousRecognition(); |
|
|
|
_resetToDefaultState(); |
|
|
|
isRecording.value = false; |
|
|
|
} |
|
|
|
|