edge-tts
Use Microsoft Edge's online text-to-speech service from Python WITHOUT needing Microsoft Edge or Windows or an API key
Python tool that converts any text to spoken MP3 audio using Microsoft Edge's free online voice service, no API key, no Windows, and no Edge browser required. Supports hundreds of voices across many languages.
edge-tts is a Python library and command-line tool that converts text into spoken audio using Microsoft Edge's text-to-speech service. It does not require Microsoft Edge, Windows, or any API key. It works by connecting to the same online service that the Edge browser uses for its built-in read-aloud feature.
From the command line you can pass in any text and get an MP3 audio file as output. The tool also generates a subtitle file alongside the audio so that the timing of each word is recorded. A companion command called edge-playback lets you hear the result immediately instead of saving it to a file, though that requires a separate media player called mpv (except on Windows).
The service supports a large number of voices across many languages, including Arabic, Afrikaans, Amharic, and many more not shown in the excerpt. You can list all available voices with a single command and then specify which one to use. Each voice has a gender and personality description listed alongside it.
Speech speed, volume, and pitch can all be adjusted through command-line options. For example, you can slow the speech to half speed, reduce the volume by 50 percent, or lower the pitch by 50Hz.
The library can also be used directly in Python code for cases where you want to generate speech as part of a larger program. The README points to example files in the repository and lists a few other projects that use it, including a Home Assistant integration and a podcast generation tool.
The project is installed via pip with a single command and has no unusual system requirements beyond Python and an internet connection.
Where it fits
- Generate MP3 narration for a video or podcast from a text script without paying for a TTS API.
- Add text-to-speech to a Python app or Home Assistant automation using the library interface.
- Convert a long article to audio to listen while commuting, with word-level subtitle timing saved alongside it.