Make the runtime a downloadable product (whisper.cpp-style), no manual export needed:
- download-funasr-model.sh: one command to pull pre-converted GGUF from Hugging Face
(FunAudioLLM/*-GGUF), incl. fsmn-vad for built-in --vad. No Python ML env required.
- convert-funasr-to-gguf.py: one-step HF/ModelScope checkpoint -> GGUF (wraps the
validated export_*.py; discovered relative to itself so it works in any layout).
- CMakeLists.txt: standalone, CI-friendly top-level build. FetchContent pins llama.cpp
(provides ggml + llama), static libs -> self-contained binaries in build/bin/, no
hardcoded paths; builds on Linux/macOS/Windows x64/arm64. `cmake -B build && cmake --build build -j`.
- README: download-first + standalone-build quickstart; links to the HF GGUF repos.
Verified on Linux: all targets build via FetchContent (static, no shared-lib deps);
hf download -> run reproduces canonical output. Additive; runtime/llama.cpp/ only.
- funasr_vad.h: define M_PI fallback (not guaranteed on MSVC) for cross-platform CI;
guard against audio shorter than one frame (empty fbank -> OOB in lfr);
validate required GGUF tensors up front (fail with a message, not a segfault);
shrink the no_alloc metadata context (512MB -> 16MB); drop a redundant ggml_cont
on an already-contiguous row slice in the FSMN memory loop.
- export_vad_gguf.py: use a with-statement when reading am.mvn (no fd leak).
No behavior change: VAD segment boundaries are byte-identical on the 184-clip set.
Add a native ggml FSMN-VAD front end so the binaries segment long audio themselves,
with no Python at runtime. New `--vad fsmn-vad.gguf` flag on llama-funasr-cli,
llama-funasr-sensevoice and llama-funasr-paraformer runs FSMN-VAD (fbank + LFR + CMVN +
FSMN encoder + E2EVadModel state machine, in funasr-common/funasr_vad.h) and decodes
each speech segment, then concatenates.
- funasr-common/funasr_vad.h: single-header VAD; segment boundaries within ~10 ms of
PyTorch fsmn-vad.generate on the 184-clip set (DEFAULT_SILENCE_SCHEDULE replicated,
chunk-stepped silence schedule + speech_noise_thres 0.5).
- funasr-vad/: standalone VAD tool (wav -> [start_ms,end_ms] segments).
- export_vad_gguf.py: export FSMN-VAD encoder + CMVN to GGUF (1.7 MB, 24 tensors).
- BENCHMARKS.md: bare binary with built-in VAD reaches the reference end-to-end —
full-184 micro-CER SenseVoice 8.01 / Paraformer 9.85 / Fun-ASR-Nano 8.30.
Additive only: no existing code is modified outside runtime/llama.cpp/.
* feat(runtime): accept any audio (any sample-rate/channels, wav/mp3/flac) via miniaudio
Replaces the 16k-mono-PCM16-only WAV reader with a miniaudio-based loader
(funasr-common/funasr_audio.h) that decodes wav/mp3/flac at any sample rate and
channel count, resampling to 16 kHz mono. Verified: a 44.1k stereo file and an 8k
mono file both transcribe correctly across cli/sensevoice/paraformer.
* fix(audio): inline loader (avoid duplicate symbols), null-path guard, check decoder read result (gemini review)
---------
Co-authored-by: LauraGPT <[email protected]>
funasr_wss_server.py was upgraded to handle multiple clients with
non-blocking inference and per-stage concurrency semaphores
(--concurrent_vad/asr_online/asr_offline/punc/sv), but quick_start docs
still said only a single client is supported. Update both EN and ZH.
Co-authored-by: LauraGPT <[email protected]>
* fix(onnxruntime): Fix Windows MSVC compilation errors
- Fix CMake syntax warning in src/CMakeLists.txt (message function quoting)
- Replace Python-style 'and' with C++ '&&' in ct-transformer-online.cpp
- Fix ssize_t redefinition conflict between kaldi and openfst on Windows
- Update yaml-cpp CMake policies from OLD to NEW for modern CMake compatibility
These changes enable successful compilation with MSVC on Windows (VS 2022)
while maintaining compatibility with other platforms.
Tested with: Visual Studio 2022, Windows 11, CMake 3.x
* Add realtime mic app and optional FFmpeg build
Move offline_msg_done signal after the ReadMessage loop exits (when
server closes connection), not on first message receipt. Previously,
multi-segment audio would only get the first segment transcribed
before the client closed the connection.
* Fix path mistake in FunASR/runtime/python /onnxruntime/README.md
“FunASR/funasr/runtime/python/onnxruntime”是一个不存在的路径,在执行“cd FunASR”之后,如果用户再执行“cd funasr/runtime/python/onnxruntime”会出现错误。
"FunASR/funasr/runtime/python/onnxruntime" is an invalid path. After executing "cd FunASR", if the user execute "cd funasr/runtime/python/onnxruntime", an error will occur.
* Change onnx to jieba in the setup.py of funasr_onnx