The default language is en-US if you don't specify a language. To change the speech recognition language, replace en-US with another supported language. OutputSpeechRecognitionResult(speechRecognitionResult) Var speechRecognitionResult = await speechRecognizer.RecognizeOnceAsync() Using var speechRecognizer = new SpeechRecognizer(speechConfig, audioConfig) Ĭonsole.WriteLine("Speak into your microphone.") Using var audioConfig = AudioConfig.FromDefaultMicrophoneInput() SpeechConfig.SpeechRecognitionLanguage = "en-US" Var speechConfig = SpeechConfig.FromSubscription(speechKey, speechRegion) Static void OutputSpeechRecognitionResult(SpeechRecognitionResult speechRecognitionResult)Ĭonsole.WriteLine($"RECOGNIZED: Text=") Ĭonsole.WriteLine($"CANCELED: Did you set the speech resource key and region values?") Static string speechRegion = Environment.GetEnvironmentVariable("SPEECH_REGION") Static string speechKey = Environment.GetEnvironmentVariable("SPEECH_KEY") This example requires environment variables named "SPEECH_KEY" and "SPEECH_REGION" Replace the contents of Program.cs with the following code. Install the Speech SDK in your new project with the. The Program.cs file should be created in the project directory. Open a command prompt where you want the new project, and create a console application with the. Recognize speech from a microphoneįollow these steps to create a new console application and install the Speech SDK. For example, westus.įor more configuration options, see the Xcode documentation. Set SPEECH_REGION to the region of your resource. To set the environment variable for your Speech resource region, follow the same steps. Enter SPEECH_KEY for the Name and enter your Speech resource key for the Value.Under Environment Variables select the plus (+) sign to add a new environment variable.Select Arguments on the Run (Debug Run) page.For example, follow these steps to set the environment variable in Xcode 13.4.1. Xcodeįor iOS and macOS development, you set the environment variables in Xcode. bash_profile, and add the environment variables: export SPEECH_KEY=your-keyĪfter you add the environment variables, run source ~/.bash_profile from your console window to make the changes effective. export SPEECH_KEY=your-keyĪfter you add the environment variables, run source ~/.bashrc from your console window to make the changes effective. For example, if you are using Visual Studio as your editor, restart Visual Studio before running the example. To learn more about using dictation, click the desktop to switch to the Finder, choose Help > macOS Help (from the Help menu at the top of your screen), then search for “dictation.If you only need to access the environment variable in the current running console, you can set the environment variable with set instead of setx.Īfter you add the environment variables, you may need to restart any running programs that will need to read the environment variable, including the console window. To add punctuation, speak its name (for example, comma or apostrophe).Ĭlick Done below the microphone when you’re finished. When the microphone appears, begin speaking. MacOS 12 or earlier: Choose Apple menu > System Preferences > Keyboard > Dictation, then change the desired settings. MacOS Ventura 13 or later: Choose Apple menu > System Settings > Keyboard, then change the desired settings. To change your dictation settings, do one of the following: When dictation is set up, you can also change the shortcut key or change the language. If you haven’t used dictation before, follow the guided setup instructions that appear. Place the insertion point where you want to begin dictating, or select the text you want to replace (to select placeholder text, click it).Ĭhoose Edit > Start Dictation (from the Edit menu at the top of your screen). If you can’t remove something from a document.Restore an earlier version of a document.Save a large document as a package file.Export to Word, PDF, or another file format.See the latest activity in a shared document.Change the look of chart text and labels.Add a legend, gridlines, and other markings.Change a chart from one type to another.Calculate values using data in table cells.Select tables, cells, rows, and columns.Fill shapes and text boxes with color or an image.Set pagination and line and page breaks.Format hyphens, dashes, and quotation marks.Format Chinese, Japanese, or Korean text.Use a keyboard shortcut to apply a text style.Create, rename, or delete a paragraph style.Bold, italic, underline, and strikethrough.Populate and create customized documents.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |