Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Read aloud
A cross-platform text-to-speech library with C interface, written in Rust.
It reverse-engineers the awesome Microsoft Edge Read aloud feature, allowing you to use it in your own projects in your preferred programming language.
Read aloud is a low-level library that is designed as a building block for higher-level text-to-speech libraries and applications.
Edge service compatibility
This crate counterfeits the communication protocol used by Microsoft Edge to work with the Read Aloud service. Any change to the upstream Edge service can break the crate, even if the public C ABI stays the same. If the service updates its protocol, authentication, or required headers, the library may need internal changes to restore functionality.
Quick verification
After building the library, you can run the bundled Python smoke test:
&&
If the request succeeds, it writes smoke_output.mp3 in the repository root.
Build requirements
This library connects to the Edge read-aloud service over secure WebSockets. TLS support is currently provided by tungstenite with its native-tls feature enabled.
On Linux, native-tls uses the system OpenSSL installation, so building this crate requires OpenSSL development files and pkg-config to be installed.
For Debian or Ubuntu:
On Windows and macOS, native-tls uses the platform TLS stack instead of OpenSSL, so this Linux-specific package installation is usually not required.
API
The library exposes a stable C ABI for text-to-speech generation and error reporting.
// Generate speech audio from text and save to a file. Returns a status code.
enum ReadAloudStatus ;
// Get a short static description for a status code.
const char *;
// Get a detailed error message for the last failure on the calling thread.
const char *;
text_to_speech returns a stable numeric status code.
read_aloud_status_string returns a short static description for that code.
read_aloud_last_error_message returns a more detailed, thread-local message describing the last failure on the calling thread. The pointer remains valid until the next library call on the same thread.
Parameters
pitch is specified in Hz.
rate must be between -1.0 and 1.0, where 0.0 is the default voice speed.
volume must be between -1.0 and 1.0, where 0.0 is the default voice volume.
Error codes
The function returns 0 on success, and a non-zero error code on failure:
Supported languages and voices
Examples
// Calling text_to_speech from C++ on Windows
typedef ;
typedef const char *;
typedef const char *;
int
=
=
=
=
=
=
=
= 223 # en_GB_ThomasNeural
=