A small C# WinForms application that lets you preview text with different Text-To-Speech voices, and save the output as a WAV file.
- Preview entered text using SAPI/OneCore voices
- Adjust speech rate, volume, and pitch
- Save the result as a
.wavfile
- Windows
- .NET Framework 4.7.2 or newer installed
- Visual Studio 2022/2026, or MSBuild, to build from source
- At least one installed text-to-speech voice
This app supports two Windows voice systems:
- Classic SAPI voices through
System.Speech.Synthesis - Windows / OneCore voices through
Windows.Media.SpeechSynthesis, when available
Windows / OneCore support is optional. If the newer speech API is unavailable on a system, the app falls back to SAPI voices only.
Voices are prefixed in the dropdown with [SAPI] or [Windows] depending on which engine the voice comes from.
Pitch is applied differently depending on the engine:
- SAPI voices use generated SSML with a numerical semitone pitch value, such as
+3stor-3st. - Windows / OneCore voices use the native
AudioPitchoption.
Some voices may interpret pitch differently or ignore it.
Program.cs Application startup
MainForm.cs WinForms UI and event handling
Models/SpeechVoice.cs Voice model used by the UI and services
Models/SpeechVoiceType.cs SAPI / Windows / header enum
Models/SpeechSettings.cs Rate, volume, and pitch settings
Services/VoiceCatalog.cs Voice discovery and optional OneCore fallback
Services/SpeechPreviewService.cs Preview playback and cancellation
Services/SpeechExportService.cs WAV export for SAPI and Windows voices
Utilities/WinRtStreamHelper.cs WinRT stream-to-byte-array helper
Utilities/WindowsSoundIcon.cs Finds a Windows audio-related icon for the form
- Open
TextToWav.slnxin Visual Studio. - Restore NuGet packages if prompted.
- Select
Releaseconfiguration. - Build the project.
- The executable will be created in
bin\Release.