Skip to content

feat(ohos): voice input via system speechRecognizer on HarmonyOS - #167

Merged
SWangHash merged 2 commits into
mainfrom
wc/bugfix3
Aug 2, 2026
Merged

feat(ohos): voice input via system speechRecognizer on HarmonyOS#167
SWangHash merged 2 commits into
mainfrom
wc/bugfix3

Conversation

@SWangHash

Copy link
Copy Markdown
Owner

Route desktop speech_* commands to the HarmonyOS system speechRecognizer (CoreSpeechKit + AudioKit) via a new ohos ArkTS VoiceInputService + EntryAbility bridge; compile speech_api.rs as cfg-gated ohos/non-ohos versions so the ohos artifact never references local sherpa-onnx models; map language auto->zh-CN (engine rejects auto with 1002200001), overwrite onResult (engine streams full results), finish returns prebuilt result when recognition already completed (avoid session id mismatch); frontend falls back to a no-op recorder when getUserMedia is denied on Tauri (HarmonyOS ArkWeb denies it) and exposes the underlying error; add ohos.permission.MICROPHONE; switch HAP frontend baseline to web-ui. Logs kept at key entry/error points only.

Summary

Fixes #

Type and Areas

Type:

Areas:

Motivation / Impact

Verification

Reviewer Notes

Checklist

  • This PR is focused and does not include secrets, temporary prompts, generated scratch files, or unrelated artifacts.
  • Relevant verification is recorded above, or skipped checks are explained.
  • User-facing strings, docs, and locales are updated where applicable.

Route desktop speech_* commands to the HarmonyOS system speechRecognizer (CoreSpeechKit + AudioKit) via a new ohos ArkTS VoiceInputService + EntryAbility bridge; compile speech_api.rs as cfg-gated ohos/non-ohos versions so the ohos artifact never references local sherpa-onnx models; map language auto->zh-CN (engine rejects auto with 1002200001), overwrite onResult (engine streams full results), finish returns prebuilt result when recognition already completed (avoid session id mismatch); frontend falls back to a no-op recorder when getUserMedia is denied on Tauri (HarmonyOS ArkWeb denies it) and exposes the underlying error; add ohos.permission.MICROPHONE; switch HAP frontend baseline to web-ui. Logs kept at key entry/error points only.
@SWangHash
SWangHash merged commit 2b70fd1 into main Aug 2, 2026
0 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant