Skip to main content

On-device speech transcription for macOS via Apple's SpeechAnalyzer

Project description

mac-speech-analyzer

🐍 Python package to run the macOS 26 SpeechAnalyzer API from Python to transcribe audio files.

The SpeechAnalyzer API generally provides faster and better results than other locally running transcription engines of comparable size.

Features

  • Online or Offline transcription
  • Automatic download of new languages

Requirements

  • macOS >= 26.0
  • XCode command-line tools

Installation

mac-speech-analyzer is currently not tracked on pypi yet.

uv add git+https://github.com/paraversal/mac-speech-analyzer
# or
pip install git+https://github.com/paraversal/mac-speech-analyzer

Usage

Basic usage

from macspeechanalyzer import transcribe

text = transcribe("/path/to/file", locale = "en_US")

Technical details

This package is made up of two parts: the Python wrapper provides the API, but the actual functionality is achieved by embedding a Swift project which exposes functions to C. With this kind of three language interplay, a clean separation of concerns is really important. Therefore, the implementation is divided into the following four layers:

  • Pure Python
  • Python → C compat
  • Swift → C compat
  • Pure Swift

The pure Swift and pure Python layers only deal with their respective languages & types, while the compat layers do all the ugly work of converting between native and C-compatible types

Roadmap

  • ✅ Basic one-shot transcription
  • Class-based interface
    • Context manager implementation
  • Transcription of live audio stream (microphone, ...)

Development

uv pip install -e .

to one-time-install the package as editable, from then on:

ninja

to rebuild the package

License

mac-speech-analyzer is released under the MIT License. See LICENSE for more details.

Project details


Download files

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

Source Distribution

mac_speech_analyzer-0.1.0.tar.gz (19.2 kB view details)

Uploaded Source

Built Distribution

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

mac_speech_analyzer-0.1.0-py3-none-macosx_26_0_arm64.whl (19.4 kB view details)

Uploaded Python 3macOS 26.0+ ARM64

File details

Details for the file mac_speech_analyzer-0.1.0.tar.gz.

File metadata

  • Download URL: mac_speech_analyzer-0.1.0.tar.gz
  • Upload date:
  • Size: 19.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.29 {"installer":{"name":"uv","version":"0.11.29","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for mac_speech_analyzer-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e3fded39cf3bc5851e49a4a9804dafb403483d0f31feefce418917f9cb0b0f9a
MD5 2ff13d2dd258a1bb4cf58593863dda00
BLAKE2b-256 a8434d9bb03166d52b3599e51e8fea7c43d664e179168004531b4767d01cb86e

See more details on using hashes here.

File details

Details for the file mac_speech_analyzer-0.1.0-py3-none-macosx_26_0_arm64.whl.

File metadata

  • Download URL: mac_speech_analyzer-0.1.0-py3-none-macosx_26_0_arm64.whl
  • Upload date:
  • Size: 19.4 kB
  • Tags: Python 3, macOS 26.0+ ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.29 {"installer":{"name":"uv","version":"0.11.29","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for mac_speech_analyzer-0.1.0-py3-none-macosx_26_0_arm64.whl
Algorithm Hash digest
SHA256 81ad0e60532af536395f2813be3ca7c17881ce0c73134c20792be6e4ce75ced5
MD5 cf49674cd9ef7846011fbba137a91707
BLAKE2b-256 901945758512d83eefb4e33ed4020209907571c10e5ac2bd80ff1aa5236dedc7

See more details on using hashes here.

Supported by

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