System.Speech 10.0.0-preview.6.25321.102

Prefix Reserved
This is a prerelease version of System.Speech.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package System.Speech --version 10.0.0-preview.6.25321.102
                    
NuGet\Install-Package System.Speech -Version 10.0.0-preview.6.25321.102
                    
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="10.0.0-preview.6.25321.102" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="System.Speech" Version="10.0.0-preview.6.25321.102" />
                    
Directory.Packages.props
<PackageReference Include="System.Speech" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add System.Speech --version 10.0.0-preview.6.25321.102
                    
#r "nuget: System.Speech, 10.0.0-preview.6.25321.102"
                    
#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.
#:package System.Speech@10.0.0-preview.6.25321.102
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=System.Speech&version=10.0.0-preview.6.25321.102&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=System.Speech&version=10.0.0-preview.6.25321.102&prerelease
                    
Install as a Cake Tool

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 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 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.  net9.0 is compatible.  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.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.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.
  • net10.0

    • No dependencies.
  • net8.0

    • No dependencies.
  • net9.0

    • No dependencies.

GitHub repositories (22)

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

Repository Stars
hanmin0822/MisakaTranslator
御坂翻译器—Galgame/文字游戏/漫画多语种实时机翻工具
ZGGSONG/STranslate
A ready-to-go translation ocr tool developed with WPF/WPF 开发的一款即用即走的翻译、OCR工具
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
microsoft/AdaptiveCards
A new way for developers to exchange card content in a common and consistent way.
NewLifeX/X
Core basic components: log (file / network), configuration (XML / JSON / HTTP), cache (memory / redis), network (TCP / UDP / HTTP), RPC framework, serialization (binary / XML / JSON), APM performance tracking. 核心基础组件,日志(文件/网络)、配置(XML/Json/Http)、缓存(内存/Redis)、网络(Tcp/Udp/Http)、RPC框架、序列化(Binary/XML/Json)、APM性能追踪。
ClassIsland/ClassIsland
一款适用于班级多媒体屏幕的课表信息显示工具,可以一目了然地显示各种信息。
VRCWizard/TTS-Voice-Wizard
Speech to Text to Speech. Song now playing. Sends text as OSC messages to VRChat to display on avatar. (STTTS) (Speech to TTS) (VRC STT System) (VTuber TTS)
ciribob/DCS-SimpleRadioStandalone
An open source Stand alone Radio for DCS integrating with all clickable cockpits and FC3 Aircraft
Esri/arcgis-maps-sdk-dotnet-samples
Sample code for ArcGIS Maps SDK for .NET – WPF, WinUI, .NET MAUI
not-nullptr/Aerochat
Native rewrite of Aerochat, a WLM 09 themed Discord client
SamsidParty/TopNotify
The Ultimate Notification Customization Tool For Windows
NewLifeX/XCoder
新生命码神工具,代码生成、网络工具、API工具、串口工具、正则工具、图标工具、加解密工具、地图接口。
rampaa/JL
JL is a program for looking up Japanese words and expressions.
Esri/developer-support
Proof of concept developer code and samples to help be successful with all ArcGIS developer products (Python, NET, JavaScript, Android…). The repository is designed to be an exchange for sharing coding conventions and wisdom to developers at all skill levels.
SaviorXTanren/mixer-mixitup
Streaming bot application for handling chat, events, moderation, and other streamer assistance features
Krypton-Suite/Extended-Toolkit
A companion toolkit for the standard toolkit.
marzent/IINACT
A Dalamud plugin to run the FFXIV_ACT_Plugin in an ACT-like enviroment with a heavily modified port of Overlay Plugin
maker-community/ElectronBot.DotNet
一个为ElectronBot机器人和瀚文键盘(HelloWorldKeyboard)开发的上位机软件(包含机器人USB操作SDK和瀚文键盘HID操作SDK),采用Windows App SDK框架编写界面。 A host computer software developed for ElectronBot robots (including robot USB operation SDK), using the Windows App SDK framework to write UI.
VE3NEA/SkyRoof
A Windows app for Hams and satellite enthusiasts