Skip to main content

edge-tts

edge-tts lets you use Microsoft Edge's online text-to-speech service from Python, or from the command line with the edge-tts and edge-playback commands.

Installation

$ uv add edge-tts          # or: pip install edge-tts

To use only the commands, install them as a tool, or run them without installing:

$ uv tool install edge-tts
$ uvx edge-tts --text "Hello, world!" --write-media hello.mp3

Command line

$ edge-tts --text "Hello, world!" --write-media hello.mp3 --write-subtitles hello.srt

To play the speech back immediately, use edge-playback, which takes the same options except --write-media, --write-subtitles and --list-voices. It requires mpv, except on Windows.

$ edge-playback --text "Hello, world!"

List the available voices with --list-voices, and pick one with --voice:

$ edge-tts --voice ar-EG-SalmaNeural --text "مرحبا كيف حالك؟" --write-media hello.mp3

Adjust the speech with --rate, --volume and --pitch. Write negative values with =, so they aren't read as options:

$ edge-tts --rate=-50% --pitch=-5Hz --text "Hello, world!" --write-media hello.mp3

Run edge-tts --help for all options. Custom SSML isn't supported, because the service only accepts the SSML that Microsoft Edge itself generates.

Python

import edge_tts

edge_tts.Communicate("Hello, world!", "en-GB-SoniaNeural").save_sync("hello.mp3")

See examples/ for async usage, streaming, subtitles and voice selection.

Troubleshooting

See TROUBLESHOOTING.md for common errors, such as NoAudioReceived, and how to deal with them.

Development

uv sync                            # create the environment from uv.lock
uv run pre-commit install          # lint, format and type-check on every commit
uv run pytest

Releases are published to PyPI automatically when a GitHub release is created.

Metadata

Release files for edge-tts 7.4.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 edge-tts 7.4.0
File Size Uploaded Provenance Actions
edge_tts-7.4.0.tar.gz 51.9 kB Without provenance Details for edge_tts-7.4.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for edge-tts 7.4.0
File Interpreter ABI Platform Actions
edge_tts-7.4.0-py3-none-any.whl Python 3 none any Details for edge_tts-7.4.0-py3-none-any.whl

Total release size: 101.7 kB

Release files / edge_tts-7.4.0.tar.gz

Download URL edge_tts-7.4.0.tar.gz
Size 51.9 kB
Tags Source
SHA-256 checksum
How to use checksums
598db07a7817700f2407ebf783de612c68958cca411487bef8c8826208dabc1c
BLAKE2b-256 checksum
How to use checksums
01df7999b3b0e264372504ab88a1bca41d5f4a9336e94d148e538b61e6f27690
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / edge_tts-7.4.0-py3-none-any.whl

Download URL edge_tts-7.4.0-py3-none-any.whl
Size 49.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bb634d36c377198235ea66ab3dc746307ec2d6799ccfdce9d67ab04e1cc90648
BLAKE2b-256 checksum
How to use checksums
46ca219d86902e9f55b9292eb84bc9a5e2943a8f0bceb4a44ec179e98c63333b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for edge-tts 7.4.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

7.4.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