How to get system win+H voice input status ,result of voice input...programaically?

Hank Lin 1 Reputation point
2024-03-08T02:36:10.37+00:00

Is there any api get information of system voice input(win+h)

I want to know some informations like open or close voice input status ,result of voice input...etc.

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,913 questions
Windows 11
Windows 11
A Microsoft operating system designed for productivity, creativity, and ease of use.
9,603 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Jiale Xue - MSFT 45,006 Reputation points Microsoft Vendor
    2024-03-08T08:14:28.6333333+00:00

    Hi @Hank Lin , Welcome to Microsoft Q&A,

    You may be looking for System.Speech.Recognition Namespace

    You create grammars, which consist of a set of rules or constraints, to define words and phrases that your application will recognize as meaningful input. Using a constructor for the Grammar class, you can create a grammar object at runtime from GrammarBuilder or SrgsDocument instances, or from a file, a string, or a stream that contains a definition of a grammar.

    Using the GrammarBuilder and Choices classes, you can programmatically create grammars of low to medium complexity that can be used to perform recognition for many common scenarios. To create grammars programmatically that conform to the Speech Recognition Grammar Specification 1.0 (SRGS) and take advantage of the authoring flexibility of SRGS, use the types of the System.Speech.Recognition.SrgsGrammar namespace. You can also create XML-format SRGS grammars using any text editor and use the result to create GrammarBuilder, SrgsDocument , or Grammar objects.

    In addition, the DictationGrammar class provides a special-case grammar to support a conventional dictation model.

    See Create Grammars in the System Speech Programming Guide for .NET Framework for more information and examples.

    Best Regards,

    Jiale


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". 

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.