System.Speech 8.0.0

Prefix Reserved
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package System.Speech --version 8.0.0                
NuGet\Install-Package System.Speech -Version 8.0.0                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="System.Speech" Version="8.0.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add System.Speech --version 8.0.0                
#r "nuget: System.Speech, 8.0.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install System.Speech as a Cake Addin
#addin nuget:?package=System.Speech&version=8.0.0

// Install System.Speech as a Cake Tool
#tool nuget:?package=System.Speech&version=8.0.0                

About

Provides APIs for speech recognition and synthesis built on the Microsoft Speech API in Windows. Not supported on other platforms.

This package is provided primarily for compatibility with code being ported from .NET Framework and is not accepting new features.

Key Features

How to Use

Synthesis example

using System.Speech.Synthesis;

// Initialize a new instance of the SpeechSynthesizer.
SpeechSynthesizer synth = new SpeechSynthesizer();

// Configure the audio output.
synth.SetOutputToDefaultAudioDevice();

// Speak a string, synchronously
synth.Speak("Hello World!");

// Speak a string asynchronously
var prompt = synth.SpeakAsync("Goodnight Moon!");

while (!prompt.IsCompleted)
{
    Console.WriteLine("speaking...");
    Thread.Sleep(500);
}

Recognition example

// Create a new SpeechRecognitionEngine instance.
using SpeechRecognizer recognizer = new SpeechRecognizer();
using ManualResetEvent exit = new ManualResetEvent(false);

// Create a simple grammar that recognizes "red", "green", "blue", or "exit".
Choices choices = new Choices();
choices.Add(new string[] { "red", "green", "blue", "exit" });

// Create a GrammarBuilder object and append the Choices object.
GrammarBuilder gb = new GrammarBuilder();
gb.Append(choices);

// Create the Grammar instance and load it into the speech recognition engine.
Grammar g = new Grammar(gb);
recognizer.LoadGrammar(g);

// Register a handler for the SpeechRecognized event.
recognizer.SpeechRecognized += (s, e) =>
{
    Console.WriteLine($"Recognized: {e.Result.Text}, Confidence: {e.Result.Confidence}");
    if (e.Result.Text == "exit")
    {
        exit.Set();
    }
};

// Emulate
Console.WriteLine("Emulating \"red\".");
recognizer.EmulateRecognize("red");

Console.WriteLine("Speak red, green, blue, or exit please...");

exit.WaitOne();

Main Types

The main types provided by this library are:

  • System.Speech.Recognition.SpeechRecognizer
  • System.Speech.Synthesis.SpeechSynthesizer

Additional Documentation

Feedback & Contributing

System.Speech is released as open source under the MIT license. Bug reports and contributions are welcome at the GitHub repository.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 is compatible.  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 is compatible.  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 is compatible.  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. 
.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 was computed. 
.NET Framework net461 was computed.  net462 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETStandard 2.0

    • No dependencies.
  • net6.0

    • No dependencies.
  • net7.0

    • No dependencies.
  • net8.0

    • No dependencies.

NuGet packages (34)

Showing the top 5 NuGet packages that depend on System.Speech:

Package Downloads
Microsoft.Windows.Compatibility

This Windows Compatibility Pack provides access to APIs that were previously available only for .NET Framework. It can be used from both .NET as well as .NET Standard.

CommunityToolkit.Maui.Core

Core library for community toolkits using .NET MAUI

Jon.Wpf.CustomControls

Jon.WPF.CustomControls is a collection of custom, reusable WPF controls. It is built with .NET 7.0 and intended to provide developers with controls that are commonly used but not included in the standard WPF toolkit.

Krypton.Toolkit.Suite.Extended.Dialogs.Nightly

An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. This package implements additional extensions to standard dialogs. This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. Also, all libraries are included targeting each specific framework version for performance purposes. To view all of the extended toolkit package latest version information, please visit: https://github.com/Krypton-Suite/Krypton-Toolkit-Suite-Version-Dashboard/blob/main/Documents/Modules/Extended/Krypton-Toolkit-Suite-Extended-Modules.md

Krypton.Toolkit.Suite.Extended.Dialogs.Canary

An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. This package implements additional extensions to standard dialogs. This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. Also, all libraries are included targeting each specific framework version for performance purposes. To view all of the extended toolkit package latest version information, please visit: https://github.com/Krypton-Suite/Krypton-Toolkit-Suite-Version-Dashboard/blob/main/Documents/Modules/Extended/Krypton-Toolkit-Suite-Extended-Modules.md

GitHub repositories (12)

Showing the top 5 popular GitHub repositories that depend on System.Speech:

Repository Stars
hanmin0822/MisakaTranslator
御坂翻译器—Galgame/文字游戏/漫画多语种实时机翻工具
Danily07/Translumo
Advanced real-time screen translator for games, hardcoded subtitles in videos, static text and etc.
CommunityToolkit/Maui
The .NET MAUI Community Toolkit is a community-created library that contains .NET MAUI Extensions, Advanced UI/UX Controls, and Behaviors to help make your life as a .NET MAUI developer easier
ZGGSONG/STranslate
A ready-to-use, ready-to-go translation ocr tool developed by WPF/WPF 开发的一款即开即用、即用即走的翻译、OCR工具
microsoft/AdaptiveCards
A new way for developers to exchange card content in a common and consistent way.
Version Downloads Last updated
9.0.0-rc.2.24473.5 140 10/8/2024
9.0.0-rc.1.24431.7 6,337 9/10/2024
9.0.0-preview.7.24405.7 5,789 8/13/2024
9.0.0-preview.6.24327.7 10,335 7/9/2024
9.0.0-preview.5.24306.7 4,924 6/11/2024
9.0.0-preview.4.24266.19 2,808 5/21/2024
9.0.0-preview.3.24172.9 7,481 4/11/2024
9.0.0-preview.2.24128.5 1,008 3/12/2024
9.0.0-preview.1.24080.9 11,525 2/13/2024
8.0.0 2,545,430 11/14/2023
8.0.0-rc.2.23479.6 213,605 10/10/2023
8.0.0-rc.1.23419.4 9,228 9/12/2023
8.0.0-preview.7.23375.6 9,350 8/8/2023
8.0.0-preview.6.23329.7 1,221 7/11/2023
8.0.0-preview.5.23280.8 1,082 6/13/2023
8.0.0-preview.4.23259.5 10,166 5/16/2023
8.0.0-preview.3.23174.8 20,103 4/11/2023
8.0.0-preview.2.23128.3 5,802 3/14/2023
8.0.0-preview.1.23110.8 8,159 2/21/2023
7.0.0 3,936,148 11/7/2022
7.0.0-rc.2.22472.3 9,044 10/11/2022
7.0.0-rc.1.22426.10 62,382 9/14/2022
7.0.0-preview.7.22375.6 10,444 8/9/2022
7.0.0-preview.6.22324.4 1,233 7/12/2022
7.0.0-preview.5.22301.12 1,339 6/14/2022
7.0.0-preview.4.22229.4 10,468 5/10/2022
7.0.0-preview.3.22175.4 3,334 4/13/2022
7.0.0-preview.2.22152.2 12,259 3/14/2022
7.0.0-preview.1.22076.8 2,488 2/17/2022
6.0.0 8,378,335 11/8/2021
6.0.0-rc.2.21480.5 4,274 10/12/2021
6.0.0-rc.1.21451.13 8,224 9/14/2021
6.0.0-preview.7.21377.19 2,636 8/10/2021
6.0.0-preview.6.21352.12 1,847 7/14/2021
6.0.0-preview.5.21301.5 5,483 6/15/2021
6.0.0-preview.4.21253.7 20,362 5/24/2021
6.0.0-preview.3.21201.4 7,622 4/8/2021
6.0.0-preview.2.21154.6 7,854 3/11/2021
6.0.0-preview.1.21102.12 3,301 2/12/2021
5.0.0 3,936,107 2/9/2021 5.0.0 is deprecated because it is no longer maintained.