System.Speech 9.0.0-rc.2.24473.5

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.

Showing the top 20 packages that depend on System.Speech.

Packages 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.
30
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.
37
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.
41
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.
47
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.
52
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.
54
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.
61
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.
75
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.
84
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.
85
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 Core as well as .NET Standard.
31
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 Core as well as .NET Standard.
37
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 Core as well as .NET Standard.
39
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 Core as well as .NET Standard.
41
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 Core as well as .NET Standard.
43
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 Core as well as .NET Standard.
48
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 Core as well as .NET Standard.
62
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 Core as well as .NET Standard.
75
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 Core as well as .NET Standard. When using NuGet 3.x this package requires at least version 3.4.
40

https://go.microsoft.com/fwlink/?LinkID=799421

.NET 8.0

  • No dependencies.

.NET 9.0

  • No dependencies.

.NET Standard 2.0

  • No dependencies.

Version Downloads Last updated
9.0.0-rc.2.24473.5 1 10/12/2024
9.0.0-rc.1.24431.7 8 09/11/2024
9.0.0-preview.7.24405.7 11 08/16/2024
9.0.0-preview.6.24327.7 8 07/10/2024
9.0.0-preview.5.24306.7 9 06/20/2024
9.0.0-preview.4.24266.19 8 05/21/2024
9.0.0-preview.3.24172.9 9 05/16/2024
9.0.0-preview.2.24128.5 9 03/13/2024
9.0.0-preview.1.24080.9 7 02/16/2024
8.0.0 15 11/20/2023
8.0.0-rc.2.23479.6 15 10/12/2023
8.0.0-rc.1.23419.4 22 09/21/2023
8.0.0-preview.7.23375.6 33 09/08/2023
8.0.0-preview.6.23329.7 36 09/09/2023
8.0.0-preview.5.23280.8 56 06/24/2023
8.0.0-preview.4.23259.5 40 06/15/2023
8.0.0-preview.3.23174.8 37 04/15/2023
8.0.0-preview.2.23128.3 39 03/22/2023
8.0.0-preview.1.23110.8 65 02/27/2023
7.0.0 91 12/04/2022
7.0.0-rc.2.22472.3 27 10/16/2022
7.0.0-rc.1.22426.10 67 09/25/2022
7.0.0-preview.7.22375.6 35 09/11/2022
7.0.0-preview.6.22324.4 83 09/23/2022
7.0.0-preview.5.22301.12 59 09/23/2022
7.0.0-preview.4.22229.4 57 09/22/2022
7.0.0-preview.3.22175.4 39 09/24/2022
7.0.0-preview.2.22152.2 88 09/24/2022
7.0.0-preview.1.22076.8 78 09/22/2022
6.0.2-mauipre.1.22102.15 39 09/25/2022
6.0.2-mauipre.1.22054.8 91 09/24/2022
6.0.0 56 09/08/2022
6.0.0-rc.2.21480.5 57 09/25/2022
6.0.0-rc.1.21451.13 41 09/23/2022
6.0.0-preview.7.21377.19 39 10/16/2022
6.0.0-preview.6.21352.12 32 09/22/2022
6.0.0-preview.5.21301.5 83 09/21/2022
6.0.0-preview.4.21253.7 98 09/21/2022
6.0.0-preview.3.21201.4 21 09/21/2022
6.0.0-preview.2.21154.6 37 09/22/2022
6.0.0-preview.1.21102.12 62 09/22/2022
5.0.0 69 09/17/2022