Skip to main content

macos-say-server

Expose macOS say as an HTTP server that provides text-to-speech audio generation.

Features

  • GET /health for liveness checks.
  • GET /voices to list the voices available from say -v '?'.
  • GET /cache/stats to inspect current cache usage and limits.
  • GET /speak?text=...&voice=... to return AIFF audio directly.
  • POST /speak with JSON { "text": "...", "voice": "..." } to return AIFF audio.
  • Disk-backed AIFF cache keyed by text + voice, with lazy TTL cleanup.

Run

uv sync
uv run macos-say-server

The server binds to 127.0.0.1:2576 by default.

Use startup arguments to override bind settings:

uv run macos-say-server --host 127.0.0.1 --port 2576

You can also run the package module directly:

uv run python -m macos_say_server --host 127.0.0.1 --port 2576

Build

uv build

Cache

The service stores generated audio under .cache/audio by default.

  • Cache key: hash of text + voice
  • Expiration: CACHE_TTL_SECONDS, default 86400 seconds
  • Cleanup: lazy cleanup during requests, at most once per CACHE_CLEANUP_INTERVAL_SECONDS, default 300 seconds
  • On cache hit, the file timestamp is refreshed, so TTL is sliding rather than fixed from first generation
  • Capacity control: optional LRU-style pruning using file modification time
  • File count limit: CACHE_MAX_FILES, default 0 meaning unlimited
  • Total size limit: CACHE_MAX_BYTES, default 0 meaning unlimited

When a cache limit is configured, the oldest entries are removed first. Because cache hits refresh the file timestamp, frequently used items stay warm and cold items are evicted first.

GET /cache/stats returns:

  • cache_dir and whether it currently exists
  • total_files and total_bytes
  • expired_files under the current TTL view
  • configured ttl_seconds, cleanup interval, and capacity limits
  • oldest and newest cache entry timestamps

Startup arguments:

uv run macos-say-server \
	--cache-dir .cache/audio \
	--cache-ttl-seconds 86400 \
	--cache-cleanup-interval-seconds 300 \
	--cache-max-files 0 \
	--cache-max-bytes 0

Examples

curl http://127.0.0.1:2576/health
curl http://127.0.0.1:2576/voices
curl http://127.0.0.1:2576/cache/stats
curl -G http://127.0.0.1:2576/speak --data-urlencode "text=hello from macos say server" --output speech.aiff
curl -i -G http://127.0.0.1:2576/speak --data-urlencode "text=hello from macos say server" --output speech.aiff
curl -X POST http://127.0.0.1:2576/speak \
	-H "content-type: application/json" \
	-d '{"text":"hello from json","voice":"Samantha"}' \
	--output speech.aiff

If you inspect response headers, X-Cache: MISS means the file was newly synthesized, and X-Cache: HIT means it was served from cache.

Metadata

Release files for macos-say-server 0.1.0

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

Source distribution (sdist)

Source distribution for macos-say-server 0.1.0
File Size Uploaded Provenance
macos_say_server-0.1.0.tar.gz 123.9 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for macos-say-server 0.1.0
File Interpreter ABI Platform
macos_say_server-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 131.1 kB

Release files / macos_say_server-0.1.0.tar.gz

Download URL macos_say_server-0.1.0.tar.gz
Size 123.9 kB
Tags Source
SHA-256 checksum
How to use checksums
fed8792c01ba45457a1d9a01de4e42ae4fcb599433bdd80a5bc5605f0dd5f1fc
BLAKE2b-256 checksum
How to use checksums
b0544ce4961fee8e07df5d74a169061cae7a17731f09ad7c31622e190fb710b8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","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}

Release files / macos_say_server-0.1.0-py3-none-any.whl

Download URL macos_say_server-0.1.0-py3-none-any.whl
Size 7.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
88061233eb91f2502e853716d073dd8f283b1f5a9f6041511f3eae9fae95b0a7
BLAKE2b-256 checksum
How to use checksums
abecd293f913dfac01f875f5d7546fd5ea498f7ce5c0001f12b1e762bf17c987
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","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}

Security for macos-say-server 0.1.0

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

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