Skip to content

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Quickstart: Synthesize speech in C# under Universal Windows Platform

This sample demonstrates how to synthesize speech with C# under the Universal Windows Platform using the Speech SDK. See the accompanying article on the SDK documentation page which describes how to build this sample from scratch in Visual Studio 2017.

Prerequisites

  • A subscription key for the Speech service. See Try the speech service for free.

  • A Windows PC with Windows 10 Fall Creators Update (10.0; Build 16299) or later and with a working speaker/headset.

  • Microsoft Visual Studio 2017, Community Edition or higher.

  • The Universal Windows Platform development workload in Visual Studio.

  • Note: processor target ARM or ARM64 is not yet supported.

    You can enable it in Tools > Get Tools and Features.

Build the sample

  • By building this sample you will download the Microsoft Cognitive Services Speech SDK. By downloading you acknowledge its license, see Speech SDK license agreement.
  • Download the sample code to your development PC.
  • Start Microsoft Visual Studio 2017 and select File > Open > Project/Solution.
  • Navigate to the folder containing this sample, and select the solution file contained within it.
  • Edit the MainPage.xaml.cs source:
    • Replace the string YourSubscriptionKey with your own subscription key.
    • Replace the string YourServiceRegion with the service region of your subscription. For example, replace with westus if you are using the 30-day free trial subscription.
  • Set the active solution configuration and platform to the desired values under Build > Configuration Manager:
    • On a 64-bit Windows installation, choose x64 as active solution platform.
    • On a 32-bit Windows installation, choose x86 as active solution platform.
  • Press Ctrl+Shift+B, or select Build > Build Solution.

Run the sample

To debug the app and then run it, press F5 or use Debug > Start Debugging. To run the app without debugging, press Ctrl+F5 or use Debug > Start Without Debugging.

After the app starts, you will see a text box and a Speak button on the app main page. You can either type some text in the text box or leave it as it is. Then click the Speak button. You will hear the text in the textbox being read out in a few seconds.

References