MicroASR for Python
中文 | English
Offline streaming RNN-T speech recognition for Python using the same plain ONNX model packages as the .NET implementation. Input audio is mono signed 16-bit little-endian PCM at exactly 16 kHz.
Models are not included in the Python package. Applications supply a compatible plain ONNX model directory at runtime.
Install
From PyPI:
python -m pip install microasr
For local development from the repository root:
python -m pip install -e ./sdk/python
NumPy and ONNX Runtime are required. Install the optional audio capture backend to use the system command:
python -m pip install -e "./sdk/python[audio]"
Commands
Recognize a WAV file on Windows, Linux, or macOS:
microasr wav models/en-US sample.wav
Read headerless mono PCM16 from standard input:
ffmpeg -i sample.mp3 -ac 1 -ar 16000 -f s16le - | microasr pcm models/en-US
Capture the default system output when the operating system exposes a loopback or monitor source:
microasr system models/en-US
System capture uses SoundCard. Windows normally exposes WASAPI loopback. Linux requires a PulseAudio/PipeWire monitor source. macOS may require a virtual audio device such as BlackHole.
Library usage
from microasr import RecognitionEventType, RnntRecognitionMode, StreamingRecognizer
def on_result(event):
if event.type is RecognitionEventType.FINAL:
print(event.text)
with StreamingRecognizer("models/en-US", RnntRecognitionMode.BALANCED) as recognizer:
recognizer.add_result_handler(on_result)
recognizer.write(pcm_chunk)
write() processes one PCM chunk synchronously and returns any events produced by that chunk. complete() flushes an active utterance. Partial and final events also go to registered handlers.
Decoder profiles and parameters
The Accuracy, Balanced, and Performance profiles match the .NET package. Accuracy uses a fixed beam of 7, Balanced uses adaptive widths of 7/6/5, and Performance uses 7/5/3. All decoder and streaming segmentation parameters are public. Start from a profile and use dataclasses.replace to override only the values required by the application. The repository tuning table documents every field and its effect.
Metadata
Release files for microasr 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| microasr-0.1.2.tar.gz | 19.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| microasr-0.1.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 39.3 kB
Release files / microasr-0.1.2.tar.gz
| Download URL | microasr-0.1.2.tar.gz |
|---|---|
| Size | 19.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
169836852d9f1384343dc299ed0f5e788d1c21a3dd862ea6e730cd52547247a1
|
|
BLAKE2b-256 checksum How to use checksums |
84c4439fe3e9fc60e4a4af48afaaeb57811b61fabf782cfffd49e30c54bd8f60
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 31, 2026.
Transparency logRelease files / microasr-0.1.2-py3-none-any.whl
| Download URL | microasr-0.1.2-py3-none-any.whl |
|---|---|
| Size | 19.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fb68aedf3dd51bd85e9ec38a21e512cd443d19527c26b36597c96d9cf5a256ea
|
|
BLAKE2b-256 checksum How to use checksums |
c0d31b4c8d0c6b27a8986e4b99d05924e110d4c8cb1e9fc63abe96af92c50f13
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 31, 2026.
Transparency log