From d582222cfa150e0c573e4a20c103411f1b5effad Mon Sep 17 00:00:00 2001 From: tanlongsheng <252620078@qq.com> Date: Fri, 19 Dec 2025 18:05:41 +0800 Subject: [PATCH 1/8] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AE=AF=E9=A3=9E?= =?UTF-8?q?=E8=AF=AD=E9=9F=B3=E8=AF=86=E5=88=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/yunqiinnovation/agent_service/AgentService.kt | 6 +++++- .../com/yunqiinnovation/azure_speech/XunFeiAsrHelper.kt | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) 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 7c7bb967c..ea41a3bfe 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 @@ -721,7 +721,11 @@ object AgentService : CoroutineScope { if (currsessionAsrId.isEmpty()) { currsessionAsrId = sessionid } - recognitionResult += result + var text = result + if(recognitionResult.isEmpty()) { + text = text.replace(Regex("^[,。?、!, . ? !]+"), "") + } + recognitionResult += text if (currentRecognitionMode == "push_to_talk") { //按住说话 sendEvent( "recognizing", mapOf( diff --git a/local_plugins/azure_speech/android/src/main/kotlin/com/yunqiinnovation/azure_speech/XunFeiAsrHelper.kt b/local_plugins/azure_speech/android/src/main/kotlin/com/yunqiinnovation/azure_speech/XunFeiAsrHelper.kt index f5a674052..daee140d5 100644 --- a/local_plugins/azure_speech/android/src/main/kotlin/com/yunqiinnovation/azure_speech/XunFeiAsrHelper.kt +++ b/local_plugins/azure_speech/android/src/main/kotlin/com/yunqiinnovation/azure_speech/XunFeiAsrHelper.kt @@ -187,6 +187,7 @@ class XunFeiAsrHelper(private val context: Context) { } if (ls && wordCount == 0 && punctuationCount == 1) { + callback.onSessionStopped(currentSessionId) return } From 240be8a5d180261bf830ec115f41675ca9a680e5 Mon Sep 17 00:00:00 2001 From: tanlongsheng <252620078@qq.com> Date: Sat, 20 Dec 2025 10:48:12 +0800 Subject: [PATCH 2/8] =?UTF-8?q?=E4=BF=AE=E6=94=B9ios=E8=AE=AF=E9=A3=9E?= =?UTF-8?q?=E8=AF=AD=E9=9F=B3=E8=AF=86=E5=88=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Sources/agent_service/AgentServiceImpl.swift | 6 +++++- .../azure_speech/Sources/azure_speech/XunFeiAsrHelper.swift | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) 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 e8aeebc20..6a3fdbdc6 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 @@ -2190,7 +2190,11 @@ extension AgentServiceImpl: AzureAsrHelper.ContinuousRecognizeCallback { if currsessionAsrId.isEmpty { currsessionAsrId = sessionid } - recognitionResult += text + var processedText = text + if recognitionResult.isEmpty { + processedText = processedText.replacingOccurrences(of: "^[,。?、!, . ? !]+", with: "", options: .regularExpression) + } + recognitionResult += processedText if (currentRecognitionMode == "push_to_talk") { //按住说话 var data: [String: Any] = [ "sessionid": currsessionAsrId, diff --git a/local_plugins/azure_speech/ios/azure_speech/Sources/azure_speech/XunFeiAsrHelper.swift b/local_plugins/azure_speech/ios/azure_speech/Sources/azure_speech/XunFeiAsrHelper.swift index 9f8dbdde2..3ec31244c 100644 --- a/local_plugins/azure_speech/ios/azure_speech/Sources/azure_speech/XunFeiAsrHelper.swift +++ b/local_plugins/azure_speech/ios/azure_speech/Sources/azure_speech/XunFeiAsrHelper.swift @@ -220,6 +220,7 @@ class XunFeiAsrHelper: NSObject, URLSessionWebSocketDelegate { } if ls && wordCount == 0 && punctuationCount == 1 { + callback?.onSessionStopped(sessionid: currentSessionId) return } From 71d970c543b7a1a1a587813e88e7ac29c8d6b293 Mon Sep 17 00:00:00 2001 From: tanlongsheng <252620078@qq.com> Date: Sat, 20 Dec 2025 10:58:37 +0800 Subject: [PATCH 3/8] =?UTF-8?q?=E4=BF=AE=E6=94=B9ios=E8=AE=AF=E9=A3=9E?= =?UTF-8?q?=E8=AF=AD=E9=9F=B3=E8=AF=86=E5=88=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../azure_speech/Sources/azure_speech/XunFeiAsrHelper.swift | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/local_plugins/azure_speech/ios/azure_speech/Sources/azure_speech/XunFeiAsrHelper.swift b/local_plugins/azure_speech/ios/azure_speech/Sources/azure_speech/XunFeiAsrHelper.swift index 3ec31244c..e2ddd5915 100644 --- a/local_plugins/azure_speech/ios/azure_speech/Sources/azure_speech/XunFeiAsrHelper.swift +++ b/local_plugins/azure_speech/ios/azure_speech/Sources/azure_speech/XunFeiAsrHelper.swift @@ -66,7 +66,10 @@ class XunFeiAsrHelper: NSObject, URLSessionWebSocketDelegate { let endJson = "{\"end\": true, \"sessionId\": \"\(sessionId)\"}" let message = URLSessionWebSocketTask.Message.string(endJson) webSocketTask.send(message) { _ in } - webSocketTask.cancel(with: .normalClosure, reason: "User stopped".data(using: .utf8)) + + DispatchQueue.main.asyncAfter(deadline: .now() + 1.0) { + webSocketTask.cancel(with: .normalClosure, reason: "User stopped".data(using: .utf8)) + } } webSocketTask = nil } From d39093c5492d7355015a206a6dcc91ae2d6bc93a Mon Sep 17 00:00:00 2001 From: tanlongsheng <252620078@qq.com> Date: Sat, 20 Dec 2025 15:59:18 +0800 Subject: [PATCH 4/8] =?UTF-8?q?=E5=8E=BB=E6=8E=89=E5=A3=B0=E9=9F=B3?= =?UTF-8?q?=E5=A4=8D=E5=88=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../translation_middleware_controller.dart | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/modules/translation/middleware/controllers/translation_middleware_controller.dart b/lib/modules/translation/middleware/controllers/translation_middleware_controller.dart index ad9473fb9..ff336f4b7 100644 --- a/lib/modules/translation/middleware/controllers/translation_middleware_controller.dart +++ b/lib/modules/translation/middleware/controllers/translation_middleware_controller.dart @@ -75,16 +75,16 @@ class TranslationMiddlewareController extends GetxController { iconColor: Colors.indigo[500]!, // 主靛 targetRoute: Routes.textTranslation, ), - TranslationOption( - translationId: 'voice_replication', - title: '声音复刻', - icon: Icons.volume_up, - startColor: Colors.pink[400]!, // 粉色 - endColor: Colors.pink[600]!, // 深粉 - iconBgColor: Colors.white, // 白色 - iconColor: Colors.pink[500]!, // 主粉 - targetRoute: Routes.voiceReplication, - ), + // TranslationOption( + // translationId: 'voice_replication', + // title: '声音复刻', + // icon: Icons.volume_up, + // startColor: Colors.pink[400]!, // 粉色 + // endColor: Colors.pink[600]!, // 深粉 + // iconBgColor: Colors.white, // 白色 + // iconColor: Colors.pink[500]!, // 主粉 + // targetRoute: Routes.voiceReplication, + // ), ]; /// 导航到指定的翻译功能 From 162c8088d111e526c802b9a2d87836795ac4a530 Mon Sep 17 00:00:00 2001 From: lxm <1274844347@qq.com> Date: Sat, 20 Dec 2025 16:15:36 +0800 Subject: [PATCH 5/8] =?UTF-8?q?chore:=20=E6=9B=B4=E6=96=B0=E5=BA=94?= =?UTF-8?q?=E7=94=A8=E7=89=88=E6=9C=AC=E5=8F=B7=E5=B9=B6=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E8=A7=86=E5=9B=BE=E4=B8=AD=E7=9A=84=E5=88=86?= =?UTF-8?q?=E9=9A=94=E7=BA=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/modules/settings/views/settings_view.dart | 5 +++++ pubspec.yaml | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/modules/settings/views/settings_view.dart b/lib/modules/settings/views/settings_view.dart index d42906ba3..d0fb47299 100644 --- a/lib/modules/settings/views/settings_view.dart +++ b/lib/modules/settings/views/settings_view.dart @@ -761,6 +761,11 @@ class SettingsView extends GetView { onTap: () => Get.toNamed(Routes.wakeupvoice), isDarkMode: isDarkMode, ), + Divider( + height: 1, + color: isDarkMode + ? Colors.white.withOpacity(0.1) + : Colors.grey[200]), _buildSimpleNavigationSetting( title: 'firmwareUpgrade'.tr, // 固件升级 subtitle: 'bleHeadsetFirmwareUpgrade'.tr, // BLE耳机固件版本升级 diff --git a/pubspec.yaml b/pubspec.yaml index 6a6fe9300..a6136b0e9 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: voitrans description: "Voitrans - AI Voice Assistant." publish_to: "none" -version: 1.0.20+67 +version: 1.0.21+71 environment: sdk: ">=3.3.0 <4.0.0" From e7bf178f6bac14dd6b8c7866f6a84b2b1c2dc8d7 Mon Sep 17 00:00:00 2001 From: lxm <1274844347@qq.com> Date: Sat, 20 Dec 2025 17:54:23 +0800 Subject: [PATCH 6/8] =?UTF-8?q?refactor(version=5Fupdate):=20=E7=AE=80?= =?UTF-8?q?=E5=8C=96=E6=B8=A0=E9=81=93=E5=BA=94=E7=94=A8=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 移除_getChannelAppInfo方法,直接使用品牌渠道或环境渠道信息 --- lib/data/services/version_update_service.dart | 42 +++++++------------ 1 file changed, 14 insertions(+), 28 deletions(-) diff --git a/lib/data/services/version_update_service.dart b/lib/data/services/version_update_service.dart index b25f861b2..106e0d9a7 100644 --- a/lib/data/services/version_update_service.dart +++ b/lib/data/services/version_update_service.dart @@ -147,14 +147,14 @@ class VersionUpdateService extends GetxService { final brandChannel = platformInfo.channel; // 环境变量渠道用于游客登录配置 - final envChannelName = dotenv.env['Channel'] ?? 'OFFICIAL'; - final envChannel = UserChannel.fromName(envChannelName); + // final envChannelName = dotenv.env['Channel'] ?? 'OFFICIAL'; + final envChannel = _channel; final AppInfo? envAppInfo = appIndex[envChannel]; // 若不存在品牌渠道信息,降级为环境渠道;仍不存在则返回无更新 - final AppInfo? chosenAppInfo = - _getChannelAppInfo(appIndex, brandChannel, envChannel); - if (chosenAppInfo == null) { + final AppInfo? brandAppInfo = appIndex[brandChannel] ?? envAppInfo; + + if (brandAppInfo == null) { _logger.w('lxm--未找到品牌或环境渠道的应用信息,返回无更新'); return VersionUpdateInfo( hasUpdate: false, @@ -164,14 +164,14 @@ class VersionUpdateService extends GetxService { ); } - _appInfo = chosenAppInfo; - _latestVersion = chosenAppInfo.version; - _updateUrl = chosenAppInfo.address; + _appInfo = brandAppInfo; + _latestVersion = brandAppInfo.version; + _updateUrl = brandAppInfo.address; // 设置游客登录显示状态(先用当前渠道结果作为回退,再用.env渠道覆盖以保持一致) - _isShowTourists = (envAppInfo ?? chosenAppInfo).tourists; + _isShowTourists = (envAppInfo ?? brandAppInfo).tourists; _allowSkipDeviceBinding = - (envAppInfo ?? chosenAppInfo).allowskipdevicebinding; + (envAppInfo ?? brandAppInfo).allowskipdevicebinding; _logger.d('lxm--从服务器获取游客登录配置(最终): ${_isShowTourists}'); @@ -186,21 +186,21 @@ class VersionUpdateService extends GetxService { // } // final appInfo = channelAppResponse.data!.app; - _hasUpdate = _compareVersions(currentVersion, chosenAppInfo.version); + _hasUpdate = _compareVersions(currentVersion, brandAppInfo.version); // 判断更新类型:如果主版本号不同则强制更新 UpdateType updateType = UpdateType.none; if (_hasUpdate!) { _isForceUpdate = - _shouldForceUpdate(currentVersion, chosenAppInfo.version); + _shouldForceUpdate(currentVersion, brandAppInfo.version); updateType = _isForceUpdate! ? UpdateType.force : UpdateType.optional; } //[3]返回版本更新信息 return VersionUpdateInfo( hasUpdate: _hasUpdate!, currentVersion: currentVersion.split('+')[0], - latestVersion: chosenAppInfo.version.split('+')[0], - appInfo: chosenAppInfo, + latestVersion: brandAppInfo.version.split('+')[0], + appInfo: brandAppInfo, updateType: updateType, ); } catch (e) { @@ -427,20 +427,6 @@ class VersionUpdateService extends GetxService { return index; } - /// 获取渠道信息,带备选策略 - /// - /// 优先返回主渠道的信息,如果主渠道不存在则返回备选渠道的信息。 - /// 主要用于: - /// 1. 版本更新:优先使用设备品牌渠道,备选使用环境变量渠道 - /// 2. 功能配置:优先使用环境变量渠道,备选使用版本更新渠道 - AppInfo? _getChannelAppInfo( - Map index, - UserChannel primary, - UserChannel? fallback, - ) { - return index[primary] ?? (fallback != null ? index[fallback] : null); - } - /// 解析版本号字符串为数字数组 List _parseVersion(String version) { final parts = version.split('.'); From 7d778e06f3878c043e465741a5987a727bc0bbc1 Mon Sep 17 00:00:00 2001 From: tanlongsheng <252620078@qq.com> Date: Mon, 22 Dec 2025 15:32:51 +0800 Subject: [PATCH 7/8] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AE=AF=E9=A3=9E?= =?UTF-8?q?=E8=AF=AD=E9=9F=B3=E8=AF=86=E5=88=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/yunqiinnovation/agent_service/AgentService.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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 ea41a3bfe..5a80023a3 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 @@ -715,7 +715,7 @@ object AgentService : CoroutineScope { } override fun onResult(sessionid:String,result: String, detectedLanguage: String) { - Log.d(TAG, "liwei-------- onResult: $sessionid ") + Log.d(TAG, "liwei-------- onResult: $sessionid $result $currentRecognitionMode") if (result.isNotEmpty()&&isKeepResult==true) {//加入是否结束要输出最后的结果判读 // 保存识别结果 if (currsessionAsrId.isEmpty()) { @@ -779,7 +779,7 @@ object AgentService : CoroutineScope { override fun onSessionStopped(sessionid:String) { - Log.d(TAG, "liwei-------- onSessionStopped: $sessionid") + Log.d(TAG, "liwei-------- onSessionStopped: $sessionid $currsessionAsrId $recognitionResult $currentRecognitionMode") if (currentRecognitionMode == "push_to_talk") { //按住说话 if (recognitionResult.isNotEmpty()){ sendEvent( @@ -854,14 +854,14 @@ object AgentService : CoroutineScope { azureAsrHelper?.stopContinuousRecognition() stopIdleCheck() // 重置识别模式 - currentRecognitionMode = "normal" + // currentRecognitionMode = "normal" return } catch (e: Exception) { Log.e(TAG, "停止语音识别异常: ${e.message}") _isRecognitionActive.set(false) stopIdleCheck() // 重置识别模式 - currentRecognitionMode = "normal" + // currentRecognitionMode = "normal" return } } From 22a422e9d34801142b602e4a244f9725992398db Mon Sep 17 00:00:00 2001 From: tanlongsheng <252620078@qq.com> Date: Mon, 22 Dec 2025 15:38:20 +0800 Subject: [PATCH 8/8] =?UTF-8?q?=E4=BF=AE=E6=94=B9ios=E8=AE=AF=E9=A3=9E?= =?UTF-8?q?=E8=AF=AD=E9=9F=B3=E8=AF=86=E5=88=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../agent_service/Sources/agent_service/AgentServiceImpl.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 6a3fdbdc6..8cdd29a31 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 @@ -548,7 +548,7 @@ class AgentServiceImpl: NSObject { } // 重置识别模式 - currentRecognitionMode = "normal" + // currentRecognitionMode = "normal" // 启动中但已请求停止,也视为已接受停止请求 return success || isStartingRecognition