diff --git a/lib/data/services/asr_service.dart b/lib/data/services/asr_service.dart index 827194a1a..4a8b34c2d 100644 --- a/lib/data/services/asr_service.dart +++ b/lib/data/services/asr_service.dart @@ -85,9 +85,6 @@ enum RecognitionEventType { /// 中间识别结果(实时反馈) intermediateResult, - /// 音频 - onAudio, - /// 会话开始 sessionStarted, diff --git a/lib/data/services/ast_service.dart b/lib/data/services/ast_service.dart index 69cd23592..244a7fb37 100644 --- a/lib/data/services/ast_service.dart +++ b/lib/data/services/ast_service.dart @@ -36,9 +36,6 @@ enum RecognitionEventType1 { /// 中间识别结果(实时反馈) intermediateResult, - /// 音频 - onAudio, - /// 会话开始 sessionStarted, diff --git a/lib/data/services/speech_impl/azure_asr_service.dart b/lib/data/services/speech_impl/azure_asr_service.dart index 7c34a204d..5137faee5 100644 --- a/lib/data/services/speech_impl/azure_asr_service.dart +++ b/lib/data/services/speech_impl/azure_asr_service.dart @@ -261,11 +261,6 @@ class AzureAsrService extends GetxService implements AsrService { // 发送到音频数据流 _audioDataStreamController?.add(data); - // 也可以通过识别事件流发送 - _eventStreamController?.add(RecognitionEvent( - type: RecognitionEventType.onAudio, - audio: data, - )); break; } } @@ -322,13 +317,6 @@ class AzureAsrService extends GetxService implements AsrService { detectedLanguage: detectedLanguage, )); break; - case 'onAudio': - final Uint8List data = eventMap['data'] as Uint8List? ?? Uint8List(0); - _eventStreamController?.add(RecognitionEvent( - type: RecognitionEventType.onAudio, - audio: data, - )); - break; case 'sessionStarted': _eventStreamController?.add(RecognitionEvent( type: RecognitionEventType.sessionStarted, diff --git a/lib/data/services/speech_impl/azure_ast_service.dart b/lib/data/services/speech_impl/azure_ast_service.dart index f66945d9f..5b5dc35da 100644 --- a/lib/data/services/speech_impl/azure_ast_service.dart +++ b/lib/data/services/speech_impl/azure_ast_service.dart @@ -97,13 +97,6 @@ class AzureAstService extends GetxService implements AstService { detectedLanguage: detectedLanguage, )); break; - case 'onAudio': - final Uint8List data = eventMap['data'] as Uint8List? ?? Uint8List(0); - _eventStreamController?.add(RecognitionEvent1( - type: RecognitionEventType1.onAudio, - audio: data, - )); - break; case 'sessionStarted': _eventStreamController?.add(RecognitionEvent1( type: RecognitionEventType1.sessionStarted, diff --git a/lib/modules/meeting/controllers/meeting_record_controller.dart b/lib/modules/meeting/controllers/meeting_record_controller.dart index eb177d910..50736fe52 100644 --- a/lib/modules/meeting/controllers/meeting_record_controller.dart +++ b/lib/modules/meeting/controllers/meeting_record_controller.dart @@ -320,10 +320,6 @@ class MeetingRecordController extends GetxController case RecognitionEventType.intermediateResult: intermediateContent.value = event.text; break; - case RecognitionEventType.onAudio: - // 添加新音频数据到波形 - _processAudioData(event.audio!); - break; case RecognitionEventType.finalResult: finalContent.value += _formatTranscript(event); intermediateContent.value = ''; diff --git a/lib/modules/speech_test/controllers/speech_test_controller.dart b/lib/modules/speech_test/controllers/speech_test_controller.dart index 5bcfc83e0..57d54bcad 100644 --- a/lib/modules/speech_test/controllers/speech_test_controller.dart +++ b/lib/modules/speech_test/controllers/speech_test_controller.dart @@ -184,9 +184,6 @@ class SpeechTestController extends GetxController { // 清空中间结果 intermediateResult.value = ''; break; - case RecognitionEventType.onAudio: - // TODO: Handle this case. - break; } }, onError: (error) { isListening.value = false; diff --git a/local_plugins/agent_service/android/src/main/kotlin/com/yunqiinnovation/agent_service/AgentService.kt b/local_plugins/agent_service/android/src/main/kotlin/com/yunqiinnovation/agent_service/AgentService.kt index 6bccc7960..0acee79b3 100644 --- a/local_plugins/agent_service/android/src/main/kotlin/com/yunqiinnovation/agent_service/AgentService.kt +++ b/local_plugins/agent_service/android/src/main/kotlin/com/yunqiinnovation/agent_service/AgentService.kt @@ -591,9 +591,7 @@ object AgentService : CoroutineScope { } - override fun onAudio(data: ByteArray) { - - } + override fun onSessionStopped() { sendEvent("recognition_stopped", mapOf("status" to "stopped")) diff --git a/local_plugins/azure_speech/android/src/main/kotlin/com/yunqiinnovation/azure_speech/AzureAsrHelper.kt b/local_plugins/azure_speech/android/src/main/kotlin/com/yunqiinnovation/azure_speech/AzureAsrHelper.kt index 048d6d74c..afc9e0409 100644 --- a/local_plugins/azure_speech/android/src/main/kotlin/com/yunqiinnovation/azure_speech/AzureAsrHelper.kt +++ b/local_plugins/azure_speech/android/src/main/kotlin/com/yunqiinnovation/azure_speech/AzureAsrHelper.kt @@ -681,13 +681,7 @@ class AzureAsrHelper(private val context: Context) { */ fun onSessionStopped() - /** - * 返回音频 - * - * @param data 识别的音频 - */ - fun onAudio(data: ByteArray) - + /** * 识别取消时调用 * diff --git a/local_plugins/azure_speech/android/src/main/kotlin/com/yunqiinnovation/azure_speech/AzureSpeechPlugin.kt b/local_plugins/azure_speech/android/src/main/kotlin/com/yunqiinnovation/azure_speech/AzureSpeechPlugin.kt index c936703af..cad5b8251 100644 --- a/local_plugins/azure_speech/android/src/main/kotlin/com/yunqiinnovation/azure_speech/AzureSpeechPlugin.kt +++ b/local_plugins/azure_speech/android/src/main/kotlin/com/yunqiinnovation/azure_speech/AzureSpeechPlugin.kt @@ -242,14 +242,6 @@ class AzureSpeechPlugin : BleService.Callback, FlutterPlugin { sendAsrEvent(mapOf("type" to "sessionStopped")) } - override fun onAudio(data: ByteArray) { - sendAsrEvent( - mapOf( - "type" to "onAudio", - "data" to data - ) - ) - } override fun onCanceled(reason: String, errorDetails: String) {