From 0634fbed4f98369640b370aef8f7631ad7e24979 Mon Sep 17 00:00:00 2001 From: lxm <1274844347@qq.com> Date: Thu, 29 Jan 2026 17:35:14 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=9B=B4=E6=96=B0=E8=AF=AD=E9=9F=B3?= =?UTF-8?q?=E6=89=93=E6=96=AD=E5=8A=9F=E8=83=BD=E6=96=87=E6=A1=88=E5=B9=B6?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=8F=90=E7=A4=BA=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 将"语音打断"功能重命名为"单轮对话"以更准确描述其行为,并添加详细说明的提示工具。同时,将iOS代理服务的默认中断状态设为false以匹配新功能逻辑。 - 更新中英文翻译文件,修改"voice_interrupt"键名对应的显示文本 - 在主页视图的开关旁添加信息图标,点击显示功能使用说明 - 调整AgentServiceImpl中isInterrupt的默认值为false,确保与单轮对话模式一致 --- lib/core/translations/language/en_us.dart | 7 ++-- lib/core/translations/language/zh_cn.dart | 4 ++- lib/modules/home/views/home_view.dart | 32 +++++++++++++++++-- .../agent_service/AgentServiceImpl.swift | 2 +- 4 files changed, 39 insertions(+), 6 deletions(-) diff --git a/lib/core/translations/language/en_us.dart b/lib/core/translations/language/en_us.dart index 6258ec09b..bce2e24c8 100644 --- a/lib/core/translations/language/en_us.dart +++ b/lib/core/translations/language/en_us.dart @@ -447,7 +447,8 @@ const Map enUS = { 'Stopping the recording timed out. Please try again.', // 结束录音超时,请重试 'meetingRecordStopFailed': 'Failed to stop the recording. Please try again.', // 结束录音失败,请重试 - 'meetingRecordSaveFailed': 'Failed to save the recording. Please try again.', // 保存录音失败,请重试 + 'meetingRecordSaveFailed': + 'Failed to save the recording. Please try again.', // 保存录音失败,请重试 'meetingRecordRecordingNotificationTitle': 'Recording in progress', // 录音进行中 'meetingRecordRecordingNotificationBody': 'Recording in background. Tap to return to the app.', // 正在后台录音,点击返回应用 @@ -771,7 +772,9 @@ const Map enUS = { "loadFailedClickRetry": "Load failed, click to retry", "swipeUpForMore": "Swipe up for more", "callingTool": "I'm helping you, please wait!", // 正在帮您,请稍等! - "voice_interrupt": "Interrupt", // 语音打断 + "voice_interrupt": "Single Round Dialog", // 单轮对话 + "voice_interrupt_tip": + "When enabled: The AI won't be interrupted by your voice while speaking and can only handle one conversation round at a time. To start a new round, just say the wake-up word.", // 开启后:AI播报时不会被语音打断,只能进行单轮对话,需要打断时请说唤醒词开启新一轮对话。关闭后:播报期间保持拾音,可能出现回声或误触发。 // 预设提示词 "presetMusic": "Play some music", diff --git a/lib/core/translations/language/zh_cn.dart b/lib/core/translations/language/zh_cn.dart index a96422446..a858ca3ec 100644 --- a/lib/core/translations/language/zh_cn.dart +++ b/lib/core/translations/language/zh_cn.dart @@ -720,7 +720,9 @@ const Map zhCN = { "loadFailedClickRetry": "加载失败,点击重试", "swipeUpForMore": "向上滑动查看更多", "callingTool": "正在帮您,请稍等!", // 正在帮您,请稍等! - "voice_interrupt": "语音打断", // 语音打断 + "voice_interrupt": "单轮对话", // 单轮对话 + "voice_interrupt_tip": + "开启后:AI播报时不会被语音打断,只能进行单轮对话,需要打断时请说唤醒词开启新一轮对话。", // 开启后:AI播报时不会被语音打断,只能进行单轮对话,需要打断时请说唤醒词。关闭后:播报期间保持拾音,可能出现回声或误触发。 // 预设提示词 "presetMusic": "来点音乐", // 来点音乐 diff --git a/lib/modules/home/views/home_view.dart b/lib/modules/home/views/home_view.dart index 4a12d4402..dab865a45 100644 --- a/lib/modules/home/views/home_view.dart +++ b/lib/modules/home/views/home_view.dart @@ -83,7 +83,7 @@ class HomeView extends GetView { crossAxisAlignment: CrossAxisAlignment.start, children: [ // 顶部标题栏 - _buildAppBar(isDarkMode), + _buildAppBar(context, isDarkMode), SizedBox(height: 10.h), @@ -154,7 +154,7 @@ class HomeView extends GetView { } // 顶部标题栏 - Widget _buildAppBar(bool isDarkMode) { + Widget _buildAppBar(BuildContext context, bool isDarkMode) { return Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ @@ -189,6 +189,34 @@ class HomeView extends GetView { color: isDarkMode ? Colors.white70 : Colors.grey[800], ), ), + SizedBox(width: 2.w), + Tooltip( + message: 'voice_interrupt_tip' + .tr, // 开启后:播报时会降低拾音以减少回声与误触发;需要打断时请按设备按键或说唤醒词。关闭后:播报期间保持拾音,可能出现回声或误触发。 + triggerMode: TooltipTriggerMode.tap, + preferBelow: true, + verticalOffset: 10.h, + padding: + EdgeInsets.symmetric(horizontal: 12.w, vertical: 10.h), + margin: EdgeInsets.symmetric(horizontal: 12.w), + showDuration: const Duration(seconds: 5), + decoration: BoxDecoration( + color: isDarkMode + ? const Color(0xFF1F1F1F) + : const Color(0xFF2A2A2A), + borderRadius: BorderRadius.circular(10.r), + ), + textStyle: TextStyle( + fontSize: 12.sp, + height: 1.35, + color: Colors.white, + ), + child: Icon( + Icons.info_outline, + size: 14.sp, + color: isDarkMode ? Colors.white54 : Colors.grey[600], + ), + ), SizedBox(width: 4.w), // 中文注释:文字与开关间距 Transform.scale( scale: 0.7, // 中文注释:缩小开关视觉尺寸,保持紧凑 diff --git a/local_plugins/agent_service/ios/agent_service/Sources/agent_service/AgentServiceImpl.swift b/local_plugins/agent_service/ios/agent_service/Sources/agent_service/AgentServiceImpl.swift index a3bfb676b..fd135db40 100644 --- a/local_plugins/agent_service/ios/agent_service/Sources/agent_service/AgentServiceImpl.swift +++ b/local_plugins/agent_service/ios/agent_service/Sources/agent_service/AgentServiceImpl.swift @@ -90,7 +90,7 @@ class AgentServiceImpl: NSObject { private var isKeepResult = true; // 新增:是否在识别过程中被中断 - public var isInterrupt: Bool = true + public var isInterrupt: Bool = false private var ttsRatePercent: Int = 25 var currsessionId: String = ""