Skip to content

feat: add funasr_asr_python local FunASR (SenseVoice) ASR extension#2191

Open
LauraGPT wants to merge 1 commit into
TEN-framework:mainfrom
LauraGPT:add-funasr-asr-extension
Open

feat: add funasr_asr_python local FunASR (SenseVoice) ASR extension#2191
LauraGPT wants to merge 1 commit into
TEN-framework:mainfrom
LauraGPT:add-funasr-asr-extension

Conversation

@LauraGPT

Copy link
Copy Markdown

Adds a funasr_asr_python ASR extension: a local, self-hosted speech-to-text backend powered by FunASR (SenseVoice / Fun-ASR-Nano / Paraformer). It mirrors the existing whisper_stt_python extension, swapping faster-whisper for a local FunASR model — strong on Chinese / Cantonese / Japanese / Korean, runs on CPU or CUDA, no API key.

What it does

  • FunASRExtension(AsyncASRBaseExtension) (vendor funasr), structured exactly like WhisperSTTExtension.
  • FunASRClient buffers 16-bit PCM, converts to float32, runs AutoModel.generate(...) off the event loop, and emits ASRResult via rich_transcription_postprocess. Default model iic/SenseVoiceSmall (auto language); swap to FunAudioLLM/Fun-ASR-Nano-2512 on GPU via config.
  • Config/manifest/property/addon/tests mirror the whisper extension; funasr is the only added dependency.

Testing

  • The core FunASRClient was verified end-to-end locally (16 kHz 16-bit PCM → FunASR → transcript via the result callback). All files pass ast syntax checks and the JSON manifests validate.
  • ten_runtime / ten_ai_base are not on PyPI, so the full in-framework wiring can't be imported standalone — the extension faithfully mirrors the working whisper_stt_python, and I'd appreciate CI / a maintainer confirming the framework integration. Happy to adjust.

@LauraGPT LauraGPT changed the title Add funasr_asr_python: local FunASR (SenseVoice) ASR extension feat: add funasr_asr_python local FunASR (SenseVoice) ASR extension Jun 22, 2026
@LauraGPT LauraGPT force-pushed the add-funasr-asr-extension branch from ede91cf to 43cbedc Compare June 22, 2026 21:40
@LauraGPT

Copy link
Copy Markdown
Author

CI note for reviewers: the only failing check is not a code/test failure.

I inspected claude-review (Claude Code Review) run 27985905295, job 82827178776. The action exits before reviewing the diff because this PR is from my fork and the actor only has read permission on TEN-framework/ten-framework:

Checking permissions for actor: LauraGPT
Permission level retrieved: read
Actor has insufficient permissions: read
Action failed with error: Actor does not have write permissions to the repository

So this check is blocked by the review action's permission policy for external contributors, not by the FunASR extension code. The PR remains MERGEABLE; it likely needs a maintainer-triggered review/run or a maintainer-side review path to clear that status.

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