Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MicroASR

中文 | English

MicroASR is an offline, streaming RNN-T real-time speech recognition toolkit built on ONNX Runtime and Microsoft's offline speech recognition models. It delivers high recognition accuracy with low resource usage, runs entirely on the CPU, and does not require a cloud speech service.

Supported languages

MicroASR provides models for 10 languages/locales:

Locale Language
da-DK Danish
de-DE German
en-US English (United States)
es-ES Spanish (Spain)
fr-FR French (France)
it-IT Italian
ja-JP Japanese
ko-KR Korean
pt-BR Portuguese (Brazil)
zh-CN Chinese (Simplified)

Performance

In a reference test on an AMD Ryzen 7 8845HS system with 16 GB LPDDR5-6000 memory, pure CPU real-time recognition used approximately 200 MB of memory and 5-10% CPU. Actual usage varies with the selected language model, audio workload, runtime, and concurrency.

Recognition modes and tuning

The .NET, C++, Python, native, and Demo interfaces use the same decoder presets:

Mode Search behavior Expected tradeoff
Accuracy Fixed beam width of 7 Retains the most candidates; highest decoder CPU cost and usually the safest choice for difficult audio
Balanced Adaptive beam widths of 7/6/5 Recommended general-purpose compromise between recognition quality and CPU usage
Performance Adaptive beam widths of 7/5/3 Lowest average decoder work; ambiguous speech may lose candidates sooner

Profiles only change decoder search. They do not change the model, audio format, or VAD threshold. The exact accuracy and speed difference depends on the language, audio, and CPU, so measure WER/CER and real-time factor on representative recordings.

All decoder and streaming segmentation options are public. .NET uses the PascalCase names below; C++ and Python expose equivalent snake_case fields. One feature frame advances by 10 ms.

Option Default Effect of increasing or enabling it
EnableAdaptiveBeam false Allows confident frames to use narrower beams, reducing average CPU at some risk to ambiguous speech
MaximumBeamWidth 7 Keeps more hypotheses and increases decoder CPU, memory, and latency; valid range is 1-32
MediumBeamWidth / MinimumBeamWidth 7 / 7 Wider adaptive beams retain more alternatives but perform more decoder work
AdaptiveBeamWarmupFrames 8 Keeps the maximum beam for longer at the start of an utterance before adaptive narrowing
MediumBeamScoreGap / MinimumBeamScoreGap 3.0 / 6.0 Higher thresholds make narrowing less frequent, favoring candidate retention over speed
TopTokensPerExpansion 2 Explores more token alternatives; supported values are 1 or 2
MaximumSymbolsPerFrame 4 Permits more non-blank tokens per acoustic frame, increasing worst-case decoder work; valid range is 1-8
PreRollFrames 75 Preserves more audio before VAD activation, helping clipped word beginnings while adding buffered context
EndSilenceFrames 50 Waits longer before finalizing, reducing splits around pauses but increasing final-result latency
MinimumSpeechFrames 8 Requires a longer voiced segment before accepting a result, filtering noise but potentially discarding very brief utterances
LowLatencySpeechFrames 100 Keeps low-latency encoder chunks for longer, improving partial responsiveness at higher sustained CPU cost
AudioQueueCapacity (.NET) 32 Absorbs larger producer bursts but can increase memory and queued-audio latency

Model downloads

Models are available in the repository's models directory. Packaged downloads are also available from:

Real-time recognition demo

demo/AudioCaptureDemo is a cross-platform Avalonia desktop application for testing MicroASR without writing integration code. It supports:

  • Windows, Linux, and macOS.
  • Selectable microphone or system-audio capture.
  • Real-time partial and final transcripts, input-level monitoring, and diagnostic logs.
  • Model-library discovery and language-model selection.
  • Chinese and English user interfaces.

Ready-to-run self-contained single-file packages for Windows, Linux, and macOS are attached to the latest GitHub Release. Each archive contains one executable; no .NET installation is required. Models remain separate and must be downloaded before recognition. Linux audio capture uses ALSA and PulseAudio/PipeWire tools. macOS capture uses ffmpeg, and system-audio capture requires BlackHole or another virtual audio device. See the demo documentation for details.

Demo videos

Windows

Test system: AMD Ryzen 7 8845HS, 16 GB LPDDR5, Windows 11 25H2.

QQ20260731-171307-HD.mp4

Linux

Host system: AMD Ryzen 7 8845HS with 16 GB LPDDR5. The demo runs in an Ubuntu 26.04 virtual machine configured with 2 vCPUs and 4 GB RAM.

QQ20260801-155723.mp4

Project layout

The repository is organized by language implementation:

Directory Status
sdk/csharp Available: .NET 8 library and NuGet package for Windows, Linux, and macOS
sdk/python Available: Python library and PyPI package for Windows, Linux, and macOS
sdk/cpp Available: C++20 static or shared library for Windows, Linux, and macOS
sdk/native C ABI shared/static libraries built with C# NativeAOT
demo Available: real-time speech recognition GUI for microphone and system-audio testing

See sdk/README.md, sdk/native/README.md, and demo/README.md for installation and usage.

About

Lightweight real-time ASR powered by a Microsoft offline speech recognition model. CPU-only, supporting 10 languages, Windows, Linux, macOS, and C#, C++, Python SDKs. 基于微软离线语音识别模型的轻量级实时 ASR,纯 CPU 运行,支持 10 种语言及 Windows、Linux、macOS,提供 C#、C++ 和 Python SDK。

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages