Skip to main content

macos-stt

Use your Mac's built-in speech recognizer from Python — zero config, fully offline, 63 languages.

PyPI Python macOS License

中文文档: README_CN.md

Stop downloading 3GB models. Your Mac already has a world-class speech recognizer built in — the same engine that powers Siri and Dictation. macos-stt wraps it into a Python library you can pip install.

Why

Every Python speech recognition tool for macOS — whisper, faster-whisper, mlx-whisper — requires downloading a model. Meanwhile, Apple's SFSpeechRecognizer sits unused in /System/Library/Frameworks/Speech.framework. We paid for this hardware. This library makes the engine accessible.

Features

  • Zero downloads — no models, no API keys, no sign-up
  • Fully offline — works in airplane mode, data never leaves your machine
  • 63 languages — including Chinese (zh-CN, yue-CN), Japanese, English, and more
  • Three interfaces — Python library, CLI, HTTP server
  • Fast — ~300ms for 3s audio on M1 Pro (ANE-accelerated)

Installation

pip install macos-stt
# macOS only. Python 3.9+.

# Optional: HTTP server support
pip install macos-stt[server]

Quick Start

Python

from macos_stt import recognize, recognize_bytes, list_languages

# 63 languages
print(len(list_languages()))  # 63

# Transcribe an audio file (WAV, MP3, M4A — anything macOS can decode)
text = recognize("recording.wav", language="zh-CN")
print(text)

# Transcribe raw PCM bytes
text = recognize_bytes(pcm_bytes, sample_rate=16000, language="en-US")

CLI

macos-stt transcribe recording.mp3 --lang zh-CN
macos-stt raw --sr 16000 < audio.pcm
macos-stt list-languages
macos-stt serve --port 8765

HTTP Server

macos-stt serve
# POST /transcribe     — file upload
# POST /transcribe/raw — base64 PCM bytes
# GET  /languages      — 63 languages
# GET  /health         — health check

Performance

macos-stt whisper (MLX) faster-whisper
3s audio (M1 Pro) ~300ms ~500ms ~800ms
Model download 0 140 MB 1.5 GB
Memory usage negligible ~500 MB ~1 GB
Languages 63 ~100 ~100

Comparison

Library Engine Model Download Offline
macos-stt macOS system 0
openai-whisper Whisper 1-3 GB
faster-whisper Whisper (CTranslate2) 1-3 GB
mlx-whisper Whisper (MLX) 1-3 GB
whisper.cpp Whisper (C++) 1-3 GB

All other options download models. macos-stt uses the engine you already own.

How It Works

macos-stt bridges Apple's SFSpeechRecognizer to Python via PyObjC — Apple's own ObjC bridge that ships with macOS. Key technical challenges solved:

  • RunLoop threading — SFSpeechRecognizer callbacks only fire on the main thread's CFRunLoop. Solved with a daemon thread running runMode:beforeDate: + threading.Event sync.
  • Authorization flowrequestAuthorization: requires RunLoop pumping during the async permission check.
  • PyObjC enum quirks — Authorization constants are flat NewType globals, not enum attributes.

Roadmap

macos-stt is the first in a planned macos-ml family:

  • macos-audioSNAudioClassifier, 425+ sound categories
  • macos-embedNLEmbedding, word vectors in 7 languages
  • macos-vision — OCR, face detection, image similarity

Same philosophy: zero downloads, use the ML engine your Mac already has.

License

MIT.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

macos_stt-0.2.0.tar.gz (11.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

macos_stt-0.2.0-py3-none-any.whl (10.3 kB view details)

Uploaded Python 3

File details

Details for the file macos_stt-0.2.0.tar.gz.

File metadata

  • Download URL: macos_stt-0.2.0.tar.gz
  • Upload date:
  • Size: 11.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.6

File hashes

Hashes for macos_stt-0.2.0.tar.gz
Algorithm Hash digest
SHA256 b5e99bf7379ac8896a7cebe8771e9a85f857f8d0103e682f91f6987625129b2d
MD5 879c0b0e26009d6aa81f652ebaf3c9e4
BLAKE2b-256 b982b534187ba05a5757bf0b47d7856288d1bc58bb007bff2ecd33f52ab9bd36

See more details on using hashes here.

File details

Details for the file macos_stt-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: macos_stt-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 10.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.6

File hashes

Hashes for macos_stt-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1ed00431ff1efab5a5bce7a498d378507ed64724e2724f7c2be32b01cd85d400
MD5 97043b8623d19cd00dafdcd2ef4e4642
BLAKE2b-256 46251e56901435f778ca3b07154e225a325e33c0829fac1763d8a3ad6eec3b6f

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 files

0.1.1

2 files

0.1.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page