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 .NET Core (Windows or Linux)

This sample demonstrates how to synthesize speech with C# under .NET 8.0 (Windows or Linux) 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.

Note: We currently only support specific Linux distributions and target architectures.

Prerequisites

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.

  • If you are using Microsoft Visual Studio on Windows:

    • Start Microsoft Visual Studio and select File > Open > Project/Solution.
    • Navigate to the folder containing this sample, and select the solution file contained within it.
  • Edit the Program.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.
  • If you are using Microsoft Visual Studio on Windows, press Ctrl+Shift+B, or select Build > Build Solution.

  • If you are using the .NET Core CLI, run the following command from the directory that contains this sample:

    dotnet build helloworld/helloworld.csproj

Run the sample

Using Visual Studio

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.

Using the .NET Core CLI

Run the following command from the directory that contains this sample:

dotnet helloworld/bin/Debug/net8.0/helloworld.dll

References