cd /news/ai-tools/text-to-speech-on-windows-the-built-… · home topics ai-tools article
[ARTICLE · art-135438] src=dev.to ↗ pub= topic=ai-tools verified=true sentiment=· neutral

Text to speech on Windows: the built-in voices, edge-tts, and why subtitle dubbing never fits

A developer compared text-to-speech options on Windows, showing that the built-in System.Speech API can synthesize speech to WAV files without installation or network access, while the edge-tts Python package drives Microsoft's neural Edge voices to produce MP3 output with matching subtitles. The writeup notes that voices installed through Windows Settings often fail to appear in System.Speech because SAPI 5 and OneCore voices live in separate registry hives, and that subtitle timings rarely accommodate synthesized narration, which typically overruns cue durations.

read2 min views2 publishedSep 21, 2026

Narration for a video, a spoken prompt in an app, a subtitle file turned into audio: all of it starts with getting text read out and saved to a file. Windows can do it with what's already installed, and the neural voices are a pip install away. Here's what each route costs you.

Narrator and Edge's Read Aloud use the built-in speech engine, but neither will save what it reads. System.Speech will:

Add-Type -AssemblyName System.Speech
$s = New-Object System.Speech.Synthesis.SpeechSynthesizer

$s.GetInstalledVoices() | ForEach-Object { $_.VoiceInfo.Name + " (" + $_.VoiceInfo.Culture + ")" }

$s.SelectVoice("Microsoft Zira Desktop")
$s.Rate = 0                      # -10 .. 10
$s.SetOutputToWaveFile("C:\temp\narration.wav")
$s.Speak((Get-Content "C:\temp\script.txt" -Raw -Encoding UTF8))
$s.Dispose()

No install, no network, and it writes a WAV. The delivery is unmistakably synthetic, so it suits prompts and beeps more than narration.

Add a voice under Settings > Time & language > Speech and it often doesn't appear in GetInstalledVoices(). The two generations of voices live in different registry hives:

Get-ChildItem 'HKLM:\SOFTWARE\Microsoft\Speech\Voices\Tokens'

Get-ChildItem 'HKLM:\SOFTWARE\Microsoft\Speech_OneCore\Voices\Tokens'

On the Windows 11 (25H2) machine I checked, the SAPI hive had two voices and the OneCore hive had a third one that System.Speech could never select. If a voice you installed isn't in the list, this is why.

The voices Edge reads pages with are neural, and edge-tts drives them directly:

pip install edge-tts

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

edge-tts --list-voices

edge-tts --voice en-US-AriaNeural --file script.txt --write-media narration.mp3

edge-tts --rate=-50% --text "Hello, world!" --write-media slower.mp3
edge-tts --volume=-50% --text "Hello, world!" --write-media quieter.mp3
edge-tts --pitch=-50Hz --text "Hello, world!" --write-media lower.mp3

Options are from the project's README and CLI help. No API key, no account, and it writes MP3 rather than WAV, which matters once a batch of scripts piles up.

A subtitle file states exactly how long each line is on screen. Read that line aloud and it is nearly always longer, because people skim subtitles while a synthesizer pronounces every syllable. Translate first and the gap widens.

cue  1  00:00:00,000 --> 00:00:03,500   (3.5s)   speech 3.2s   fits
cue  2  00:00:03,500 --> 00:00:07,000   (3.5s)   speech 4.6s   overruns into cue 3
cue  3  00:00:07,000 --> 00:00:12,000   (5.0s)   speech 4.4s   fits

What actually works:

Making something new rather than dubbing? Generate the narration first and cut the visuals to its length. Then nothing has to be squeezed.

edge-tts, but they are Microsoft's service, so read the terms before shipping commercial work. Figures are from September 2026 and these terms change often. "Free to generate, but not for monetised content" is a common combination, and it's the sort of thing that surfaces after the video is published.

The full version, with diagrams and a GUI option for people who don't want a terminal:

Which route do you use for narration?

── more in #ai-tools 4 stories · sorted by recency
── more on @microsoft 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/text-to-speech-on-wi…] indexed:0 read:2min 2026-09-21 ·