Replace the contents of main.cpp with the following code: #include // cin, cout
Install the Speech SDK in your new project with the NuGet package manager. You install the Speech SDK in the next section of this article, but first check the SDK installation guide for any more requirements Synthesize to speaker outputĬreate a new C++ console project in Visual Studio. The Speech SDK is available as a NuGet package and implements. You can use the Azure portal or Azure Command Line Interface (CLI) to remove the Speech resource you created.
To change the speech synthesis language, replace en-US-JennyNeural with another supported voice. See the Cognitive Services security article for more information. For production, use a secure way of storing and accessing your credentials like Azure Key Vault.
Remember to remove the key from your code when you're done, and never post it publicly. In Program.cs, replace YourSubscriptionKey with your Speech resource key, and replace YourServiceRegion with your Speech resource region. OutputSpeechSynthesisResult(speechSynthesisResult, text) Ĭonsole.WriteLine("Press any key to exit.") Var speechSynthesisResult = await speechSynthesizer.SpeakTextAsync(text) Get text from the console and synthesize to the default speaker.Ĭonsole.WriteLine("Enter some text that you want to speak >") Using (var speechSynthesizer = new SpeechSynthesizer(speechConfig)) SpeechConfig.SpeechSynthesisVoiceName = "en-US-JennyNeural" The language of the voice that speaks. Var speechConfig = SpeechConfig.FromSubscription(YourSubscriptionKey, YourServiceRegion) Static void OutputSpeechSynthesisResult(SpeechSynthesisResult speechSynthesisResult, string text)Ĭase ResultReason.SynthesizingAudioCompleted:Ĭonsole.WriteLine($"Speech synthesized for text: ") Ĭonsole.WriteLine($"CANCELED: Did you set the speech resource key and region values?") Static string YourServiceRegion = "YourServiceRegion" Static string YourSubscriptionKey = "YourSubscriptionKey" Replace the contents of Program.cs with the following code. Install the Speech SDK in your new project with the. Open a command prompt where you want the new project, and create a console application with the. Synthesize to speaker outputįollow these steps to create a new console application and install the Speech SDK. You install the Speech SDK in the next section of this article, but first check the SDK installation guide for any more requirements. For more information about Cognitive Services resources, see Get the keys for your resource. After your Speech resource is deployed, select Go to resource to view and manage keys.
The downloading MP3 feature is only available in the Plus Plan. The platform also offers speed adjusting, uploading files, and downloading MP3. And each language will have at least two different voices. Whereas, the Plus users will have access to 22 different languages. And its language will have one to four distinct voices. The premium users will get access to almost 12 different languages. Being a free user, you will only have access to three voices. NaturalReader has three options to choose from – Free, Premium, and Plus. All you have to do is, just enable the Dyslexia Font option. One can easily read the content written in its editor box for a person with Dyslexia. The most important reason to choose the NaturalReader is that it comes with the “Dyslexia Font” option. NaturalReader is a free TTS service provider, and the best on the list when it comes to accessibility. Key Features: 10 million characters limit | 4 distinct voices