VoiceCommandEngine.VoiceCommandEngine C# (CSharp) Méthode

VoiceCommandEngine() public méthode

public VoiceCommandEngine ( string callName ) : System
callName string
Résultat System
    public VoiceCommandEngine(string callName)
    {
        this.callName = callName;

        engine = new SpeechRecognitionEngine();
        engine.SetInputToDefaultAudioDevice();

        var choice = new Choices(new[] {
            "open",
            "open file",
            "mute",
            "unmute",
            "increase volume",
            "raise volume",
            "volume up",
            "decrease volume",
            "lower volume",
            "volume down",
            "hide",
            "show",
            "help",
            "stop listening",
            "close",
            "play",
            "pause",
            "rewind",
            "stop",
            "next chapter",
            "skip chapter",
            "previous chapter",
            "next",
            "next file",
            "previous",
            "previous file",
            "fullscreen",
            "view fullscreen",
            "go fullscreen",
            "exit fullscreen",
            "leave fullscreen",
            "whats playing"
        });

        var grammarBuilder = new GrammarBuilder(callName);
        grammarBuilder.Append(choice.ToGrammarBuilder());

        // add the grammars
        engine.LoadGrammarAsync(new Grammar(grammarBuilder));

        // adds handlers for the grammar's speech recognized event.
        engine.SpeechRecognized += recognizer_SpeechRecognized;
        engine.AudioLevelUpdated += engine_AudioLevelUpdated;
    }