Skip to content

Add C++ example for streaming ASR with SenseVoice. #2199

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

csukuangfj
Copy link
Collaborator

Usage

git clone https://github.com/k2-fsa/sherpa-onnx
cd sherpa-onnx
mkdir build
cd build
cmake ..
make

wget https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/silero_vad.onnx

wget https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-sense-voice-zh-en-ja-ko-yue-2024-07-17.tar.bz2
tar xvf sherpa-onnx-sense-voice-zh-en-ja-ko-yue-2024-07-17.tar.bz2
rm sherpa-onnx-sense-voice-zh-en-ja-ko-yue-2024-07-17.tar.bz2

./bin/sense-voice-simulate-streaming-microphone-cxx-api

@csukuangfj csukuangfj force-pushed the cxx-sense-voice-simulate-streaming branch from bfb1d5b to 9043a61 Compare May 10, 2025 16:12
@csukuangfj
Copy link
Collaborator Author

Video demo

real-time-asr-with-sense-voice.mov

@csukuangfj
Copy link
Collaborator Author

By the way, this method applies also to other non-streaming asr models, e.g., whisper, moonshine, parakeet-tdt-0.6B-v2, etc.

@csukuangfj csukuangfj merged commit 028b8f2 into k2-fsa:master May 10, 2025
187 of 218 checks passed
@csukuangfj csukuangfj deleted the cxx-sense-voice-simulate-streaming branch May 10, 2025 16:23
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