feat: add Tencent Cloud ASR support (streaming + file recognition) - #110
Open
jiesou wants to merge 8 commits into
Open
feat: add Tencent Cloud ASR support (streaming + file recognition)#110jiesou wants to merge 8 commits into
jiesou wants to merge 8 commits into
Conversation
- Implement TencentStreamAsrEngine with WebSocket-based real-time ASR (HMAC-SHA1 auth) - Implement TencentFileAsrEngine with TC3-HMAC-SHA256 REST API (one-sentence recognition) - Add Tencent to AsrVendor enum and AsrVendorRegistry with tags (Online, Streaming, NonStreaming, Accurate) - Expose AppId, SecretId, SecretKey, engine type, streaming toggle, and VAD toggle in Prefs - Add UI configuration fields: credential inputs, streaming switch, engine type dropdown, VAD switch - Register engine in all factory tables (direct mic, Push PCM, file recognizer) - Add engine mode resolver support for streaming/non-streaming selection - Add Chinese, Arabic, Japanese, Traditional Chinese string resources - Add comprehensive tests: baseline, factory, resolver, registry, and stream engine unit tests
…cent engines - Remove extractJsonStr, extractJsonInt, extractJsonStrRaw functions from TencentFileAsrEngine (hand-rolled string parsing, error-prone) - Replace all calls in TencentStreamAsrEngine with JSONObject.optXxx() - Update unit tests to use JSONObject directly - Simplify class-level KDoc to bare doc URL
As the newest provider, Tencent should consistently appear last in every enum, when-chain, data class, list, and conditional branch. This avoids scattered insertion points and follows the convention.
- Add feature_tencent_vad_on_desc/off_desc strings in 5 locales - Wire VAD switch through toRouteState parameter chain - Add applyTencentVadSwitch handler with feature explainer dialog
jiesou
marked this pull request as ready for review
July 30, 2026 12:55
Without this, a CancellationException would be swallowed by the generic Throwable catch, breaking coroutine cancellation.
Replace string interpolation with JSONObject to avoid injection issues from special characters in base64 audio. Also rethrow CancellationException and make buildJsonPayload internal for test access.
- enqueuePcm had a TOCTOU race: wsReady was checked outside the lock - wssJob was never cancelled in cancelAll() - clientOwned was dead code after removing dispatcher shutdown - Add log warning for mismatched sampleRate/channels in appendPcm
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.
概述
新增腾讯云 ASR 完整接入,支持实时/流式和一句话/非流两种识别模式。
因为看到了腾讯云 ASR 每月有 5 小时免费额度,然后效果很不错,于是考虑接入
单元测试是不连 api,只是测本地逻辑
连 api 我自己测试是没问题的