From 3ece30692668607bda256b35bfdedd07280c09d7 Mon Sep 17 00:00:00 2001 From: lxm <1274844347@qq.com> Date: Wed, 31 Dec 2025 10:44:05 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E7=A7=BB=E9=99=A4FTFTranslation?= =?UTF-8?q?=E6=A8=A1=E5=9D=97=E5=8F=8A=E7=9B=B8=E5=85=B3=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 移除不再使用的面对面翻译功能模块,包括路由配置、视图、控制器、绑定类及相关服务代码 清理设置界面中已注释的面对面翻译测试入口 --- .../speech_impl/xunfei_asr_service.dart | 349 ------------------ .../bindings/FTFTranslation_binding.dart | 10 - .../FTFTranslation_controller.dart | 246 ------------ .../views/FTFTranslation_view.dart | 212 ----------- lib/modules/settings/views/settings_view.dart | 22 -- lib/routes/app_pages.dart | 9 - lib/routes/app_routes.dart | 1 - 7 files changed, 849 deletions(-) delete mode 100644 lib/data/services/speech_impl/xunfei_asr_service.dart delete mode 100644 lib/modules/FTFTranslation/bindings/FTFTranslation_binding.dart delete mode 100644 lib/modules/FTFTranslation/controllers/FTFTranslation_controller.dart delete mode 100644 lib/modules/FTFTranslation/views/FTFTranslation_view.dart diff --git a/lib/data/services/speech_impl/xunfei_asr_service.dart b/lib/data/services/speech_impl/xunfei_asr_service.dart deleted file mode 100644 index 284e50519..000000000 --- a/lib/data/services/speech_impl/xunfei_asr_service.dart +++ /dev/null @@ -1,349 +0,0 @@ -import 'dart:async'; -import 'dart:convert'; -import 'dart:typed_data'; -import 'package:crypto/crypto.dart'; -import 'package:record/record.dart'; -import 'package:web_socket_channel/web_socket_channel.dart'; -import '../../../core/utils/logger.dart'; -import 'package:get/get.dart'; -import '../asr_service.dart'; - -/// 讯飞 语音识别服务 -/// -class XunfeiAsrService extends GetxService implements AsrService { - final String baseUrl = 'wss://rtasr.xfyun.cn/v1/ws'; - final int _chunkSize = 1280; // 每次发送的数据大小 - - final String appId = '43d87d22'; - final String apiKey = '83f063755e8d342670002f50a4471d42'; - - AudioRecorder? recorder; - Timer? _timer; - - WebSocketChannel? _channel; - bool isConnected = false; //是否链接 - - bool _isInitialized = false; - - final List _defaultSupportedLanguages = ['zh-CN']; - String _languageStr = 'cn'; - - // 连续识别相关 - bool _isContinuousRecognitionActive = false; - StreamController? _eventStreamController; - - @override - List get supportedLanguages => _defaultSupportedLanguages; - - Uint8List _buff = Uint8List(0); //音频缓存区 - BytesBuilder _originaBytes = BytesBuilder(); //原始音频 - bool isRecording = false; - - @override - Future initialize({ - List? supportedLanguages, - }) async { - try { - final List languages = - supportedLanguages ?? _defaultSupportedLanguages; - - String languagetoStr = languages.first.split('-')[1].toLowerCase(); - _languageStr = languagetoStr; - - _isInitialized = true; - Logger.info('Azure 语音识别服务初始化成功'); - return true; - } catch (e) { - Logger.error('Azure 语音识别服务初始化失败: ${e.toString()}'); - _isInitialized = false; - rethrow; - } - } - - @override - Future recognizeOnce() async { - if (!_isInitialized) { - await initialize(); - } - - try { - throw Exception('无效的识别结果格式'); - } catch (e) { - Logger.error('语音识别失败: ${e.toString()}'); - return RecognitionEvent.error(e.toString()); - } - } - - // @override - // Future> startContinuousRecognition( - // bool audioSourceType) async { - // if (!_isInitialized) { - // await initialize(); - // } - - // try { - // _eventStreamController = StreamController.broadcast(); - - // await recorder?.dispose(); - // recorder = AudioRecorder(); - // Stream? stream = await recorder?.startStream( - // const RecordConfig( - // sampleRate: 16000, - // encoder: AudioEncoder.pcm16bits, - // numChannels: 1, - // ), - // ); - // isRecording = true; - // stream?.listen((data) { - // if (isRecording) { - // _buff = _appendToBuffer(data); - // _originaBytes.add(data); - // } - // }); - // await _tryConnecting(); - // _timer = Timer.periodic(const Duration(milliseconds: 40), (timer) async { - // //每40毫秒读取一次数据 - // var frame = _getAudioData(); - // if (frame.isNotEmpty) { - // _channel?.sink.add(frame); - // } - // }); - - // _isContinuousRecognitionActive = true; - // return _eventStreamController!.stream; - // } catch (e) { - // Logger.error('开始连续语音识别失败: ${e.toString()}'); - // rethrow; - // } - // } - - //写入音频数据到缓存区中 - Uint8List _appendToBuffer(Uint8List newData) { - var newBuffer = Uint8List(_buff.length + newData.length); - newBuffer.setAll(0, _buff); - newBuffer.setAll(_buff.length, newData); - return newBuffer; - } - - //读取缓存区中一帧数据 - Uint8List _getAudioData() { - if (_buff.length >= _chunkSize) { - // 从缓冲区中读取1280字节的数据 - var data = _buff.sublist(0, _chunkSize); - // 移除已读取的数据 - _buff = _buff.sublist(_chunkSize); - return data; - } else { - return _buff; - } - } - - //尝试连接 - Future _tryConnecting() async { - try { - final url = _geturl(); - _channel = WebSocketChannel.connect(Uri.parse(url)); - _channel?.stream.timeout(const Duration(seconds: 10)); //设置超时时间 - await _channel?.ready; - isConnected = true; - _channel?.stream.listen( - (message) { - _handle(message); - }, - onError: (error) { - isConnected = false; - Logger.error('连接失败: ${error.toString()}'); - }, - onDone: () { - isConnected = false; - Logger.error('WebSocket 连接已关闭!'); - }, - cancelOnError: true, - ); - } catch (e) { - Logger.error("初始化异常----------------${e.toString()}"); - } - } - - //处理数据 - void _handle(data) { - try { - final result = jsonDecode(data); - if (result['code'] == "0" && result['data'] != "") { - final data = jsonDecode(result['data']); - String msg = ""; - String role = ''; - - List rtList = data['cn']['st']['rt']; - for (var rt in rtList) { - for (var ws in rt['ws']) { - for (var ws in ws['cw']) { - msg += ws['w']; - if (ws['rl'] != "0") { - role = ws['rl']; - } - } - } - } - Logger.info( - "识别到的内容 type:${data['cn']['st']['type']} msg:$msg rl:$role"); - if (msg.isNotEmpty) { - if (data['cn']['st']['type'] == "0") { - _eventStreamController?.add(RecognitionEvent( - type: RecognitionEventType.finalResult, - text: msg, - role: role, - audio: _originaBytes.toBytes(), - )); - _originaBytes.clear(); - } else { - _eventStreamController?.add(RecognitionEvent( - type: RecognitionEventType.intermediateResult, - text: msg, - role: role, - )); - } - } - } - } catch (e) { - Logger.error("接受消息异常 ${e.toString()}"); - } - } - - ///获取链接地址 - String _geturl() { - // 生成时间戳 - String ts = (DateTime.now().millisecondsSinceEpoch ~/ 1000).toString(); - // 计算 baseString - String baseString = md5.convert(utf8.encode(appId + ts)).toString(); - // 计算 signa - var hmacSha1 = Hmac(sha1, utf8.encode(apiKey)); - var signa = hmacSha1.convert(utf8.encode(baseString)); - String signaBase64 = base64Encode(signa.bytes); - String url = ""; - // 构建 WebSocket URL - url = - '$baseUrl?appid=$appId&ts=$ts&lang=$_languageStr&roleType=2&signa=${Uri.encodeComponent(signaBase64)}'; - return url; - } - - @override - Future stopContinuousRecognition() async { - try { - await recorder?.stop(); - isRecording = false; - _timer?.cancel(); - _buff = Uint8List(0); - _originaBytes = BytesBuilder(); - if (isConnected) { - _channel?.sink.add(utf8.encode('{"end": true}')); //结束 - } - - _isContinuousRecognitionActive = false; - return true; - } catch (e) { - Logger.error('停止连续语音识别失败: ${e.toString()}'); - rethrow; - } - } - - @override - bool isContinuousRecognitionActive() { - return _isContinuousRecognitionActive; - } - - @override - Future dispose() async { - try { - await stopContinuousRecognition(); - recorder?.dispose(); - _channel?.sink.close(); - - _eventStreamController?.close(); - _eventStreamController = null; - - _isInitialized = false; - - Logger.info('Azure 语音识别资源已释放'); - } catch (e) { - Logger.error('释放语音识别资源失败: ${e.toString()}'); - _isInitialized = false; - } - } - - @override - Future enableRecord(bool audioSourceType, String filePath, - {bool acceptAudioData = false}) { - // TODO: implement enableRecord - throw UnimplementedError(); - } - - @override - Future stopRecord(bool isSave) { - // TODO: implement stopRecord - throw UnimplementedError(); - } - - @override - Future pauseRecord() { - // TODO: implement pauseRecord - throw UnimplementedError(); - } - - @override - Future moveFile(String sourcePath, String destPath) { - // TODO: implement moveFile - throw UnimplementedError(); - } - - @override - Future renameFile(String filePath, String newName) { - // TODO: implement renameFile - throw UnimplementedError(); - } - - @override - Future disableBluetoothAudio() { - // TODO: implement disableBluetoothAudio - throw UnimplementedError(); - } - - @override - Future restoreOriginalAudioState() { - // TODO: implement restoreOriginalAudioState - throw UnimplementedError(); - } - - @override - Future> recognizeCallback() { - // TODO: implement recognizeCallback - throw UnimplementedError(); - } - - @override - Future startContinuousRecognition( - bool audioSourceType, { - bool isRemoveFirstPunctuation = true, - }) { - // TODO: implement startContinuousRecognition - throw UnimplementedError(); - } - - @override - Future setAudioConfig({int sampleRate = 16000, int channels = 1}) { - // TODO: implement setAudioConfig - throw UnimplementedError(); - } - - @override - Future resumeRecord() { - // TODO: implement resumeRecord - throw UnimplementedError(); - } - - @override - Stream? getAudioDataStream() { - // TODO: implement getAudioDataStream - throw UnimplementedError(); - } -} diff --git a/lib/modules/FTFTranslation/bindings/FTFTranslation_binding.dart b/lib/modules/FTFTranslation/bindings/FTFTranslation_binding.dart deleted file mode 100644 index 85e44791c..000000000 --- a/lib/modules/FTFTranslation/bindings/FTFTranslation_binding.dart +++ /dev/null @@ -1,10 +0,0 @@ -import 'package:get/get.dart'; -import '../controllers/FTFTranslation_controller.dart'; - -class FTFTranslationBinding extends Bindings { - @override - void dependencies() { - // 注册实时语音聊天控制器 - Get.lazyPut(() => FTFTranslationController()); - } -} diff --git a/lib/modules/FTFTranslation/controllers/FTFTranslation_controller.dart b/lib/modules/FTFTranslation/controllers/FTFTranslation_controller.dart deleted file mode 100644 index 9e55b7d18..000000000 --- a/lib/modules/FTFTranslation/controllers/FTFTranslation_controller.dart +++ /dev/null @@ -1,246 +0,0 @@ -import 'dart:async'; -import 'dart:typed_data'; - -import 'package:get/get.dart'; -import '../../../core/utils/logger.dart'; -import '../../../data/services/asr_service.dart'; -import '../../../data/services/speech_impl/xunfei_asr_service.dart'; -import '../../../data/services/tts_service.dart'; -import '../../../data/services/language_manager.dart'; -import '../../../data/services/volcano_translation_service.dart'; - -class FTFTranslationController extends GetxController - with GetSingleTickerProviderStateMixin { - final messages = [].obs; - final isChineseInput = true.obs; - final leftLanguage = '中文'.obs; - final rightLanguage = 'English'.obs; - final isLeftInput = true.obs; - - final supportedLanguages = const [ - '中文', - 'English', - '日本語', - '한국어', - 'Español', - ]; - - late final AsrService _asrService; - - StreamSubscription? _recognitionSubscription; - - RxString intermediateContent = ''.obs; - RxString finalContent = ''.obs; - BytesBuilder _originaBytes = BytesBuilder(); //原始音频 - - final VolcanoTranslationService _translationService = - Get.find(); - final LanguageManager _languageManager = Get.find(); - // 当前使用的TTS服务 - late TtsService _ttsService; - final isTranslating = false.obs; - final sourceLanguageCode = 'zh-CN'.obs; - final targetLanguageCode = 'en-US'.obs; - final isTtsEnabled = true.obs; - var _currsessionid = ''; - @override - void onInit() { - super.onInit(); - Get.put(XunfeiAsrService()); - final TtsService _ttsService = Get.find(); - _asrService = Get.find(); - _InfoRecorder(); - } - - @override - void onClose() { - _asrService.dispose(); - _recognitionSubscription?.cancel(); - super.onClose(); - } - -//开始录音 - Future _InfoRecorder() async { - final recognitionStream = await _asrService.recognizeCallback(); - _recognitionSubscription = recognitionStream.listen( - _handleRecognitionEvent, - ); - } - - //开始录音 - Future _startRecorder() async { - await _asrService.startContinuousRecognition(false); - } - - //结束录音 - Future _stopRecorder() async { - await _asrService.stopContinuousRecognition(); - } - - // 处理语音识别事件 - void _handleRecognitionEvent(RecognitionEvent event) { - switch (event.type) { - case RecognitionEventType.intermediateResult: - intermediateContent.value = event.text; - handleFinalResult(event.text); - break; - case RecognitionEventType.finalResult: - finalContent.value += _spliceText(event); - intermediateContent.value = ''; - _originaBytes.add(event.audio!); - handleIntermediateResult(event.text); - break; - default: - // 不做任何处理 - break; - } - } - - // 翻译文本 - Future translateText(String sourceText, - {bool isFinal = false}) async { - if (sourceText.isEmpty) return null; - - isTranslating.value = true; - String? translationResult; - - try { - // 根据检测到的语言确定源语言和目标语言 - final bool shouldSwap = - intermediateContent.value == sourceLanguageCode.value; - final detectedSourceLanguageCode = - shouldSwap ? sourceLanguageCode.value : targetLanguageCode.value; - final detectedTargetLanguageCode = - shouldSwap ? targetLanguageCode.value : sourceLanguageCode.value; - - // 调用翻译服务 - translationResult = await _translationService.translateText( - text: sourceText, - sourceLanguageCode: detectedSourceLanguageCode, - targetLanguageCode: detectedTargetLanguageCode, - ); - - if (translationResult != null) { - // 查找匹配的项目 - 优先使用timestamp查找 - int index = -1; - - // 播放TTS - 只在最终结果时播放 - if (isTtsEnabled.value && isFinal) { - // Logger.info('播放翻译文本: ${translationResult}'); - await playTranslatedText(translationResult); - } - } - } catch (e) { - Logger.error('翻译失败: ${e.toString()}'); - } finally { - isTranslating.value = false; - } - - return translationResult; - } - - // 处理中间识别结果 - void handleIntermediateResult(String text) { - if (text.isEmpty) return; - - translateText(text, isFinal: false); - } - - // 处理最终识别结果 - Future handleFinalResult(String text) async { - if (text.isEmpty) return; - - // 使用项目的时间戳进行翻译 - translateText(text, isFinal: true); - } - - // 播放翻译文本 - Future playTranslatedText(String text) async { - if (text.isEmpty) return; - - try { - final bool shouldSwap = - intermediateContent.value == targetLanguageCode.value; - final detectedTargetLanguageCode = - shouldSwap ? sourceLanguageCode.value : targetLanguageCode.value; - final voiceName = _languageManager - .getTtsVoiceNameByAsrCode(detectedTargetLanguageCode) ?? - 'en-US-AriaNeural'; - - await _ttsService.setVoice(voiceName); - await _ttsService.speakOnce(_currsessionid, text); - } catch (e) { - Logger.error('播放翻译失败: ${e.toString()}'); - } - } - - String _spliceText(RecognitionEvent event) { - String eventText = event.text; - String text = ''; - if (finalContent.value.isNotEmpty) { - if (event.role != '') { - final punctuations = { - ',', - '。', - '!', - '?', - ';', - ':', - ',', - '.', - ':', - ';', - '!', - '?' - }; - final firstChar = eventText[0]; - if (punctuations.contains(firstChar)) { - text += '$firstChar\n'; - eventText = eventText.substring(1); - } else { - text += '\n'; - } - text += '说话人${event.role}:'; - } - } else { - text += '说话人${event.role}:'; - } - text += eventText; - return text; - } - - void addMessage(String text) { - final fromLang = - isLeftInput.value ? leftLanguage.value : rightLanguage.value; - final toLang = isLeftInput.value ? rightLanguage.value : leftLanguage.value; - - messages.add( - FTFTranslationMessage( - original: text, - translated: '[$fromLang → $toLang] $text (翻译模拟)', - isChineseSpeaker: isLeftInput.value, - ), - ); - } - - void swapLanguages() { - final temp = leftLanguage.value; - leftLanguage.value = rightLanguage.value; - rightLanguage.value = temp; - isLeftInput.value = !isLeftInput.value; - } - - void toggleInputSide(bool isLeft) => isLeftInput.value = isLeft; -} - -class FTFTranslationMessage { - final String original; - final String translated; - final bool isChineseSpeaker; - - FTFTranslationMessage({ - required this.original, - required this.translated, - required this.isChineseSpeaker, - }); -} diff --git a/lib/modules/FTFTranslation/views/FTFTranslation_view.dart b/lib/modules/FTFTranslation/views/FTFTranslation_view.dart deleted file mode 100644 index 84d8c1c6a..000000000 --- a/lib/modules/FTFTranslation/views/FTFTranslation_view.dart +++ /dev/null @@ -1,212 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:get/get.dart'; -import '../controllers/FTFTranslation_controller.dart'; - -class FTFTranslationView extends GetView { - const FTFTranslationView({Key? key}) : super(key: key); - - @override - Widget build(BuildContext context) { - final TextEditingController inputController = TextEditingController(); - - return Scaffold( - backgroundColor: const Color(0xFF0E0F12), - appBar: AppBar( - backgroundColor: Colors.black, - title: const Text('面对面翻译'), - centerTitle: true, - ), - body: Column( - children: [ - Expanded( - child: Obx(() => ListView.builder( - padding: const EdgeInsets.all(16), - itemCount: controller.messages.length, - itemBuilder: (context, index) { - final msg = controller.messages[index]; - final isChinese = msg.isChineseSpeaker; - return Align( - alignment: isChinese - ? Alignment.centerLeft - : Alignment.centerRight, - child: Container( - margin: const EdgeInsets.symmetric(vertical: 6), - padding: const EdgeInsets.all(12), - decoration: BoxDecoration( - color: isChinese ? Colors.blue : Colors.grey[800], - borderRadius: BorderRadius.circular(12), - ), - constraints: const BoxConstraints(maxWidth: 300), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - msg.original, - style: const TextStyle( - color: Colors.white, - fontWeight: FontWeight.bold, - ), - ), - const SizedBox(height: 4), - Text( - msg.translated, - style: TextStyle( - color: Colors.white.withOpacity(0.9), - fontSize: 14, - ), - ), - ], - ), - ), - ); - }, - )), - ), - _buildBottomInput(inputController), - ], - ), - ); - } - - Widget _buildBottomInput(TextEditingController inputController) { - return Obx(() { - final isLeftInput = controller.isLeftInput.value; - final inputLang = isLeftInput - ? controller.leftLanguage.value - : controller.rightLanguage.value; - - return Container( - color: Colors.black, - padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 8), - child: Column( - children: [ - Row( - children: [ - Expanded( - child: TextField( - controller: inputController, - style: const TextStyle(color: Colors.white), - decoration: InputDecoration( - filled: true, - fillColor: Colors.grey[900], - hintText: '请输入 $inputLang 内容', - hintStyle: const TextStyle(color: Colors.grey), - border: OutlineInputBorder( - borderRadius: BorderRadius.circular(8), - borderSide: BorderSide.none, - ), - contentPadding: - const EdgeInsets.symmetric(horizontal: 12), - ), - ), - ), - IconButton( - onPressed: () { - final text = inputController.text.trim(); - if (text.isNotEmpty) { - controller.addMessage(text); - inputController.clear(); - } - }, - icon: const Icon(Icons.send, color: Colors.white), - ), - ], - ), - const SizedBox(height: 8), - Row( - children: [ - Expanded( - child: _buildLanguageDropdown( - selected: controller.leftLanguage.value, - items: controller.supportedLanguages, - onChanged: (value) { - if (value != null) controller.leftLanguage.value = value; - }, - icon: Icons.headphones, - isSelected: isLeftInput, - label: '左方语言', - onTapInputSide: () => controller.toggleInputSide(true), - ), - ), - const SizedBox(width: 12), - GestureDetector( - onTap: controller.swapLanguages, - child: Container( - padding: const EdgeInsets.all(8), - decoration: BoxDecoration( - color: Colors.white10, - shape: BoxShape.circle, - ), - child: - const Icon(Icons.compare_arrows, color: Colors.white), - ), - ), - const SizedBox(width: 12), - Expanded( - child: _buildLanguageDropdown( - selected: controller.rightLanguage.value, - items: controller.supportedLanguages, - onChanged: (value) { - if (value != null) controller.rightLanguage.value = value; - }, - icon: Icons.smartphone, - isSelected: !isLeftInput, - label: '右方语言', - onTapInputSide: () => controller.toggleInputSide(false), - ), - ), - ], - ), - ], - ), - ); - }); - } - - Widget _buildLanguageDropdown({ - required String selected, - required List items, - required void Function(String?) onChanged, - required IconData icon, - required bool isSelected, - required String label, - required VoidCallback onTapInputSide, - }) { - return GestureDetector( - onTap: onTapInputSide, - child: Container( - padding: const EdgeInsets.symmetric(vertical: 8, horizontal: 12), - decoration: BoxDecoration( - border: Border.all( - color: isSelected ? Colors.white : Colors.grey, - ), - borderRadius: BorderRadius.circular(24), - color: isSelected ? Colors.white10 : Colors.transparent, - ), - child: Row( - children: [ - Icon(icon, color: Colors.white), - const SizedBox(width: 8), - Expanded( - child: DropdownButton( - dropdownColor: Colors.grey[900], - value: selected, - isExpanded: true, - underline: const SizedBox(), - iconEnabledColor: Colors.white, - style: const TextStyle(color: Colors.white), - items: items.map((lang) { - return DropdownMenuItem( - value: lang, - child: Text(lang), - ); - }).toList(), - onChanged: onChanged, - ), - ), - ], - ), - ), - ); - } -} diff --git a/lib/modules/settings/views/settings_view.dart b/lib/modules/settings/views/settings_view.dart index 36adb6597..cda1f4f10 100644 --- a/lib/modules/settings/views/settings_view.dart +++ b/lib/modules/settings/views/settings_view.dart @@ -634,28 +634,6 @@ class SettingsView extends GetView { // color: isDarkMode // ? Colors.white.withOpacity(0.1) // : Colors.grey[200]), - // 面对面翻译测试 - // _buildSimpleNavigationSetting( - // title: '面对面翻译测试', - // subtitle: '测试面对面翻译', - // icon: Icons.bluetooth_searching, - // iconBgColor: isDarkMode - // ? Colors.green[900]!.withOpacity(0.3) - // : Colors.green[100]!, - // iconColor: - // isDarkMode ? Colors.green[300]! : Colors.green[600]!, - // titleColor: isDarkMode ? Colors.white : null, - // subtitleColor: isDarkMode ? Colors.white70 : null, - // onTap: () { - // Get.toNamed(Routes.ftftranslation); - // }, - // isDarkMode: isDarkMode, - // ), - // Divider( - // height: 1, - // color: isDarkMode - // ? Colors.white.withOpacity(0.1) - // : Colors.grey[200]), // //BLE测试 // 支付测试 diff --git a/lib/routes/app_pages.dart b/lib/routes/app_pages.dart index da70a66cb..c9b6ec60c 100644 --- a/lib/routes/app_pages.dart +++ b/lib/routes/app_pages.dart @@ -64,8 +64,6 @@ import '../modules/realtime/bindings/realtime_binding.dart'; import '../modules/realtime/views/realtime_view.dart'; import '../modules/music/views/music_playlist_view.dart'; import '../modules/music/bindings/music_playlist_binding.dart'; -import '../modules/FTFTranslation/bindings/FTFTranslation_binding.dart'; -import '../modules/FTFTranslation/views/FTFTranslation_view.dart'; import '../modules/payment/bindings/payment_binding.dart'; import '../modules/payment/views/payment_view.dart'; import '../modules/translation/middleware/views/translation_middleware_view.dart'; @@ -278,13 +276,6 @@ abstract class AppPages { transition: Transition.rightToLeft, transitionDuration: Duration(milliseconds: 250), ), - GetPage( - name: Routes.ftftranslation, - page: () => const FTFTranslationView(), - binding: FTFTranslationBinding(), - transition: Transition.noTransition, - transitionDuration: Duration(milliseconds: 250), - ), GetPage( name: Routes.opusTest, page: () => const OpusTestView(), diff --git a/lib/routes/app_routes.dart b/lib/routes/app_routes.dart index e56f5208e..be5b03701 100644 --- a/lib/routes/app_routes.dart +++ b/lib/routes/app_routes.dart @@ -36,7 +36,6 @@ abstract class Routes { static const usageStats = '/usage/stats'; // 用量统计 static const speechDemo = '/speech_demo'; // 语音演示 static const translationList = '/translation/List'; // 翻译历史 - static const ftftranslation = '/ftftranslation'; // 面对面翻译 // 测试路由(生产环境建议移除) static const ttsTest = '/tts_test'; // 文字转语音测试 static const asrTest = '/asr_test'; // 语音识别测试