EdgeTtsSharp.NAudio
2.0.4
dotnet add package EdgeTtsSharp.NAudio --version 2.0.4
NuGet\Install-Package EdgeTtsSharp.NAudio -Version 2.0.4
<PackageReference Include="EdgeTtsSharp.NAudio" Version="2.0.4" />
paket add EdgeTtsSharp.NAudio --version 2.0.4
#r "nuget: EdgeTtsSharp.NAudio, 2.0.4"
// Install EdgeTtsSharp.NAudio as a Cake Addin #addin nuget:?package=EdgeTtsSharp.NAudio&version=2.0.4 // Install EdgeTtsSharp.NAudio as a Cake Tool #tool nuget:?package=EdgeTtsSharp.NAudio&version=2.0.4
EdgeTTS Sharp
Overview
EdgeTTS Sharp is a .NET Standard 2.1 library that provides an easy-to-use interface for text-to-speech (TTS) synthesis using Microsoft's Edge voices. It is designed to work across different systems and environments, offering flexible ways to handle audio streams. Whether you need real-time streaming, file saving, or direct playback, EdgeTTS Sharp makes it simple to integrate high-quality TTS into your applications.
Key Features
✔ Real-time audio streaming – Start playback immediately as the first audio packet arrives.
✔ Save to file – Store generated speech as an audio file while streaming.
✔ Stream to third-party services – Send audio directly to a network stream (e.g., HTTP response).
✔ Cross-platform support – Works on any system supporting .NET Standard 2.1.
✔ Windows-specific playback support – Utilize NAudio for local playback on Windows.
EdgeTtsSharp
EdgeTts.GetAudioStream
Returns a stream that starts playing immediately once the first audio packet arrives.
var voice = await EdgeTts.GetVoice("en-US-ChristopherNeural");
await using var stream = voice.GetAudioStream("test");
// use the stream here
EdgeTts.SaveAudioToFile
Uses GetAudioStream
internally and redirects the stream to a file. The saving process starts immediately when the first packet arrives.
var voice = await EdgeTts.GetVoice("en-US-ChristopherNeural");
await voice.SaveAudioToFile("test", @"d:\test\test1.mp3");
EdgeTts.StreamText
Streams audio directly to a specified output stream, such as an HTTP response body. If HTTP headers are set correctly, browsers can start playback before the download finishes, showing the progress indicator as the audio loads.
[HttpGet("api/audio/{id}")]
[Produces("audio/mpeg")]
[ResponseCache(NoStore = true, Location = ResponseCacheLocation.None)]
...
var voice = await EdgeTts.GetVoice("en-US-ChristopherNeural");
// stream audio directly to HttpResponse as it's being downloaded
await voice.StreamText(this.Response.Body, "test");
EdgeTts.GetVoices
Provides an offline lookup of all available voices from Edge_tts_sharp. If the list is outdated, feel free to report it.
EdgeTts.GetVoice
Retrieves a specific voice using its short name (e.g., "en-US-ChristopherNeural"
).
EdgeTtsSharp.NAudio (Windows-Specific)
This module is for Windows users who want local playback using NAudio. However, due to NAudio's limitations, it requires downloading the entire stream before playback begins.
EdgeTtsWindowsPlayback.PlayText
var voice = await EdgeTts.GetVoice("en-US-ChristopherNeural");
await voice.PlayText("test");
License
EdgeTtsSharp is licensed under the MIT License.
The configuration file containing the list of available voices was taken from Entity-Now/Edge_tts_sharp, and the authentication method is also inspired by that project.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 is compatible. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- EdgeTtsSharp (>= 2.0.4)
- NAudio.Core (>= 2.2.1)
- NAudio.Wasapi (>= 2.2.1)
- System.Text.Json (>= 9.0.2)
-
.NETStandard 2.1
- EdgeTtsSharp (>= 2.0.4)
- NAudio.Core (>= 2.2.1)
- NAudio.Wasapi (>= 2.2.1)
- System.Text.Json (>= 9.0.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
2.0.4 | 111 | 2/17/2025 |