aspeak: a Rust CLI for Azure TTS, with profiles and a Python binding
A simple text-to-speech client for Azure TTS API.
At a glance
- What is it?
- aspeak wraps the Azure Speech synthesis API in a command line tool and a Python module. It is small, MIT licensed, and installs from GitHub Releases, AUR, PyPI or cargo, but it is useless without an Azure subscription key.
- Who is it for?
- Adopt aspeak if you already hold an Azure Speech key and want a scriptable synthesizer that keeps its settings in a TOML profile and can also be imported from Python. Do not adopt it if you need offline synthesis, a macOS or Windows GUI, or a tool that works without a cloud account, because the README describes no local engine.
- Can I use it commercially?
- Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Activity is slowing. The repository last received commits 7 months ago.
- What is it written in?
- Mainly Rust, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on November 21, 2026, and from our analysis. They are not legal advice.
Star history
- kxxt/aspeak495 ★ · -1
| Repository | 2026-09-17 | 2026-11-21 |
|---|---|---|
| kxxt/aspeak | 496 | 495 |
-1 Stars in the last 65 days, measured from the daily GitHub snapshot. Compare with other projects
Editorial analysis
What aspeak actually does, and who it is for
aspeak is a client, not a speech engine. It sends text to the Azure Text to Speech API and writes the returned audio to a file or plays it. The README describes it as "A simple text-to-speech client for Azure TTS API", and that framing is accurate: every synthesis request leaves your machine and is billed against an Azure Speech resource.
The audience is narrow and specific. You need an Azure account with a Speech resource, and you need to be comfortable on a command line or inside a Rust or Python program. The README points readers at the Azure pricing page and notes that the free tier includes 0.5 million characters per month. That quota is the practical reason many people end up here: it covers a lot of short utterances, so a hobby project or an internal tool can run at no cost.
The other audience is developers embedding synthesis in a larger program. The crate is built as both a library and a binary, and the python feature produces a Python extension module. The examples directory contains Rust files for synthesizing text files, for the REST synthesizer, and for the WebSocket synthesizer, which tells you the library surface is meant to be used directly rather than only through the CLI.
REST by default, WebSocket on request, and why the switch exists
Version 6.0.0 changed the default transport. The README states that from 6.0.0 aspeak uses the RESTful API of Azure TTS by default, and that you can get the WebSocket API back with --mode websocket on the command line or mode = "websocket" in the auth section of a profile. That is a deliberate trade: REST is simpler to reason about and easier to put behind an ordinary HTTP proxy, while WebSocket keeps a connection open and can stream audio as it is produced.
The crate features mirror this split. rest-synthesizer pulls in bytes, while websocket-synthesizer pulls in tokio-tungstenite, tokio, futures-util, tokio-socks, chrono and uuid. A unified-synthesizer feature ties the two behind async-trait, and the synthesizers feature enables all three. If you build from source and only ever intend to use REST, disabling the WebSocket feature removes a meaningful dependency tree. The README does not document how to do that selectively, but Cargo.toml exposes the features, so the choice is available to anyone building the crate themselves.
TLS is also a feature decision. The default-tls feature maps to native-tls, and Cargo.toml offers native-tls-vendored, rustls-tls-native-roots and rustls-tls-webpki-roots as alternatives. On a system where you cannot install OpenSSL headers, the rustls variants are the escape hatch. This is the kind of detail that decides whether a static build succeeds on an unfamiliar base image.
Installing aspeak and synthesizing your first line
The README recommends downloading a release archive for most users. Extract it, and you get a single binary to place somewhere on your PATH. Arch Linux users get the shorter route through AUR, where the package is named aspeak-bin and is available from v4.1.0 onward.
If you prefer cargo, the CLI-only build is one command:
cargo install aspeak -F binaryThe -F binary flag enables the binary feature, which is what pulls in clap, toml, dirs and the audio playback dependency. The crate declares rust-version = "1.85" and edition 2024, so an older toolchain will refuse the build rather than fail obscurely.
Authentication options go before the subcommand. A first synthesis with a region and a subscription key looks like this:
aspeak --region <YOUR_REGION> --key <YOUR_SUBSCRIPTION_KEY> text "Hello World"If your resource uses a custom endpoint rather than a region, swap --region for --endpoint. The README also documents two environment variables, ASPEAK_AUTH_KEY for key authentication and ASPEAK_AUTH_TOKEN for token authentication, added in v5.2.0. Those are the better choice in CI, since they keep the secret out of shell history and out of any process listing.
Repeating the key on every call gets old, so aspeak v4 introduced profiles. Create the default one, then edit it:
aspeak config init
aspeak config editIf the editor step misbehaves, aspeak config where prints the profile path and you can open the TOML file yourself. The profile carries an [auth] section, a [text] section with voice, locale, rate, pitch, role, style and style_degree, and an [output] section with container and quality. The comments in the generated file are the real documentation for these keys. The README itself does not spell out every default, so read the file after generating it rather than guessing.
Where aspeak breaks down
The dependency on Azure is total. There is no local synthesis path in the README, no fallback engine, and no offline mode. If your network drops or Azure returns an error, aspeak has nothing to say. For an air-gapped environment, or for anything where the text cannot leave the machine, this is the wrong tool and no configuration will fix it.
Proxy support has a documented gap. The README says aspeak supports http and socks5 proxies and states plainly that there is no https support yet. It also respects HTTP_PROXY or http_proxy. So a corporate environment that only exposes an HTTPS proxy is not covered by the --proxy flag, and the README does not describe a workaround.
The Python packaging is the other soft spot. The README says prebuilt wheels are only available for x86_64, that the source distribution has not been uploaded to PyPI, and that Linux wheels are missing because of manylinux compatibility issues. The pip command pins an exact version:
pip install -U aspeak==6.0.0Note that this pin is older than the current crate version of 6.1.0 in Cargo.toml. If you install from PyPI you are getting 6.0.0, not the latest release. On ARM or on Linux you are building from source with maturin, which means a Rust toolchain and the build steps in the README, including merge-wheel.bash. That is a real cost for a Python user who expected a one-line install.
Finally, the repository's last push was on 2026-04-23, and the most recent release listed is v6.1.0 from 2025-03-28. The project is not archived, but the gap between the last release and the last commit is worth noticing before you build a long-lived dependency on it.
How aspeak compares with the Azure Speech SDK and with local engines
The most direct alternative is Microsoft's own Azure Speech SDK. That SDK is the official client, ships bindings for many languages, and covers recognition, translation and synthesis in one package. aspeak covers synthesis only. The difference in approach is configuration: the SDK expects you to construct a SpeechConfig in code and manage its lifetime, while aspeak puts the same settings in a TOML profile that a shell script can reuse without any code at all. If you want one tool that also does speech recognition, the SDK is the obvious pick. If you want `aspeak text "..."` in a Makefile, aspeak is lighter.
On the other side sit local engines such as eSpeak and the various neural models that run on your own hardware. Those produce audio without a network call and without per-character billing, at the cost of voice quality and setup effort. The trade is not subtle: aspeak buys Azure's neural voices and pays for them in characters and in a dependency on a remote service. Pick aspeak when voice quality matters and the text is not sensitive. Pick a local engine when it is the other way around.
Within the Azure route, the REST versus WebSocket choice is the one real architectural decision aspeak exposes. REST is the default since 6.0.0 and is the safer choice behind proxies and in short-lived processes. WebSocket is there for cases where you want the stream, and the README treats it as an opt-in rather than the normal path.
Editorial conclusion
Adopt aspeak if you already hold an Azure Speech key and want a scriptable synthesizer that keeps its settings in a TOML profile and can also be imported from Python. Do not adopt it if you need offline synthesis, a macOS or Windows GUI, or a tool that works without a cloud account, because the README describes no local engine. Before committing, verify three things: that the PyPI wheel exists for your architecture and platform, that your proxy scheme is http or socks5 rather than https, and which container and quality pair your profile selects, since the README says aspeak adjusts the quality automatically when the two disagree.
Frequently asked questions
Does aspeak work without an Azure subscription key?
No. aspeak is a client for the Azure TTS API, so every synthesis request needs a subscription key, an authorization token, a region or a custom endpoint. The README documents no offline or local synthesis mode.
How do I install aspeak on Linux?
The README recommends downloading a release archive and putting the binary on your PATH, or installing aspeak-bin from AUR on Arch Linux. From source, cargo install aspeak -F binary builds the CLI. Note that PyPI wheels for Linux are not available because of manylinux compatibility issues.
How do I avoid passing the Azure key on every aspeak command?
Store it in a profile. Run aspeak config init to create the default profile and aspeak config edit to open it, then put the key in the [auth] section. From v5.2.0 you can also set ASPEAK_AUTH_KEY or ASPEAK_AUTH_TOKEN in the environment.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/kxxt-aspeak)Star history chart for your README
[](https://hysenlabs.com/projects/kxxt-aspeak)Was this useful?