Skip to main content

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. 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.

Metadata

Release files for microasr 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for microasr 0.1.1
File Size Uploaded
microasr-0.1.1.tar.gz 19.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for microasr 0.1.1
File Interpreter ABI Platform
microasr-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 38.9 kB

Release files / microasr-0.1.1.tar.gz

Download URL microasr-0.1.1.tar.gz
Size 19.3 kB
Tags Source
SHA-256 checksum
How to use checksums
80d67de476cf37935f429d6a9c00f87dbf2d5e10de5039f0e54fdea85caf0b70
BLAKE2b-256 checksum
How to use checksums
ae8e2fc3ed5d0859c9e61ba09312ad85b075dbb934eaa568016dd1ba3665042b
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

Release files / microasr-0.1.1-py3-none-any.whl

Download URL microasr-0.1.1-py3-none-any.whl
Size 19.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4dd244ec9b45066509edfb9a47f56db449bd4dda0a2b0aad733e380184bb575d
BLAKE2b-256 checksum
How to use checksums
f48dcda47119ce4cfb9632745adf6fabf5e9d609436642e5d6c6288c09206d48
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

Release history Release notifications | RSS feed

0.1.2

2 release files

This release

0.1.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page