Repository navigation
feat(android/voice): online/offline engine adapters, safe model switching and import completion (#149) - #150
Open
Slacker-LLC wants to merge 54 commits into
Open
Slacker-LLC wants to merge 54 commits into
Slacker-LLC wants to merge 54 commits into
Conversation
…ntization and provenance
…-flight ASR sessions
…-flight ASR sessions
…hout blocking settings UI
…ping active editor
…ecycle on confirmation
…on and Done restart
…ded PCM on API 34
…system transaction
… service teardown
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue #149:Android 语音模型与识别运行时解耦
本 PR 仍只推送到
feat/voice-engine-adapters-149,目标分支为main,未合并。已实现
VoiceEngineAdapter/VoiceEngineRegistry:根据经过校验的 manifest 选择已编译引擎;未知引擎或格式/语音模式拒绝并解释原因。VoiceModelRuntime/VoiceModelSession,保留原 sherpa-onnx 流式接口及 PCM 录音管线,支持纯最终结果的离线推理(不伪装 partial)。OnlineRecognizer与基于 sherpa-onnx 1.13.6 真实 API 的OfflineRecognizer。离线模型需明确声明engineId=sherpa-onnx-offline、recognitionMode=offline及 family/file roles;目前支持离线 Paraformer、Transducer、Zipformer CTC、NeMo CTC 的适配定义。这是在线/离线两种识别模式,不是声称适配了第二种独立推理框架。engineId、recognitionMode、schemaVersion、modelFormat、sampleRate、channelCount、quantization、licenseId、sourceUrl,新增字段纳入信任指纹,旧模型指纹不变。docs/VOICE_ENGINE_ADAPTERS.md。验证与安全边界
voice-beta4.wav录音,调用真实内置 Paraformer 解码并检查最终文本;该测试必须以 CI 通过为准。\n- GitHub Actions Android CI:./gradlew :app:testDebugUnitTest :app:lintDebug :app:assembleDebug :app:assembleDebugAndroidTest,通过后继续 API 26/29/31/34 模拟器仪表测试;以 CI 实际结论为准,未通过前不宣称完成验证。INTERNET权限、无录音落盘、禁用任意 native 插件装载。Related #149、#147。该 PR 不自动关闭 #149;需先审阅构建、仪表测试及实际 ASR 验证。
本轮继续补充
独立的
VoiceModelInstallTransaction:可回滚 staged→installed 替换;恢复崩溃留下的备份,不覆盖已装的可用模型。VoiceModelRepository跨实例安装互斥与持久化信任状态恢复,避免预热/安装竞争导致异常回滚。VoiceModelInstallTransactionTest六项验证:成功、校验失败、原生加载失败回滚、两种中断恢复和危险路径拒绝。Android 14 增加
VoiceOfflineEngineInstrumentedTest:CI 临时下载 sherpa 官方 NeMo CTC 英文小模型,ADB 放入调试应用私有目录,以真正的 sherpaOfflineRecognizer完成最终结果解码,验证离线模式不输出流式 partial;其他 API 不下载模型,不影响正式 APK 体积。完整验收以当前功能分支最新 CI 为准;该测试的成功结果不代表所有第三方离线模型均受支持。
录音期模型操作准入:记录当前语音手势 generation,禁止导入、切换、删除;迟到的上一会话 final 不会解除当前手势保护,并添加对应 JUnit 测试。