Skip to content

Latest commit

 

History

History
68 lines (50 loc) · 3.46 KB

File metadata and controls

68 lines (50 loc) · 3.46 KB

Quickstart: Translate speech in C# for .NET Core on Windows or Linux (Ubuntu 16.04, Ubuntu 18.04, Debian 9)

This sample demonstrates how to translate speech with C# under .NET Core 2.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 2017.

Prerequisites

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

  • A PC (Windows x64, Ubuntu 16.04 x64, Ubuntu 18.04 x64, Debian 9 x64) with a working microphone.

  • Either one of the following:

  • On Ubuntu, run the following commands for the installation of required packages:

    sudo apt-get update
    sudo apt-get install libssl1.0.0 libasound2
  • On Debian 9, run the following commands for the installation of required packages:

    sudo apt-get update
    sudo apt-get install libssl1.0.2 libasound2

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 2017 on Windows:

    • 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 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 2017 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 2017

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/netcoreapp2.0/helloworld.dll

References