

OutputFormat = AudioOutputFormat.Riff16Khz16BitMonoPcm,ĪuthorizationToken = "Bearer " + accessTokenĪwait speaker.Speak(CancellationToken.None, options) VoiceName = "Microsoft Server Speech Text to Speech Voice (en-US, ZiraRUS)", Var options = new Synthesize.InputOptions Speaker.OnAudioAvailable += Speaker_OnAudioAvailable Initialize the OnAudio Available Event Paste the Key which we got from the Azure PortalĪuthentication auth = new Authentication("**********")

The below Authentication class is available on the class TTSClient, which can be got //from the attached source code Public static async Task Speak(string speech) using CognitiveServicesTTS Ĭonsole.WriteLine("Enter the Text to Speak : ") Now, edit the Program.CS and paste the below code. If we get any App break exception, then refer to the previous articleġ3. Execute the Application and we will see the below exception.ġ2. Hence, the NuGet Package name is like ProjectOxford instead of Cognitive Services.ġ1. Initially the project Name was ProjectOxford before the Cognitive Services. Add the NuGet Package for Azure Speech Recognition. With this, now, come back to the Visual Studio.Ĩ. Make a note of the End Point and any of the Key. We will get the End Point and the Keys for the Speech API. Add the Bing Speech API (Which is valid for 30 days)Ħ. We can see the list of APIs provided by Microsoft.ĥ. Click on Login and Login with the valid credential.Ĥ.

Login to the portal with a valid Azure Account.ģ.
#Microsoft azure speech to text api examples how to#
In this article, let us see how to create an Azure Cognitive Services – Text to Speech API Application using C# and the Speech Recognition API.īefore getting started, we need to get the Azure Subscription or even a 30 days trial is also offered by Microsoft.Īs usual, let us go by step by step procedures.ġ.
