Quickstart: Setup development environment

Choose your target environment

This guide shows how to install the Speech SDK for .NET Framework (Windows).

Important

By downloading any of the Speech SDK for Azure Cognitive Services components on this page, you acknowledge its license. See the Microsoft Software License Terms for the Speech SDK.

Prerequisites

This quickstart requires:

Create a Visual Studio project and install the Speech SDK

You'll need to install the Speech SDK NuGet package so you can reference it in your code. To do that, you may first need to create a helloworld project. If you already have a project with the .NET desktop development workload available, you can use that project and skip to Use NuGet Package Manager to install the Speech SDK.

Create helloworld project

  1. Open Visual Studio 2019.

  2. In the Start window, select Create a new project.

  3. In the Create a new project window, choose Console App (.NET Framework), and then select Next.

  4. In the Configure your new project window, enter helloworld in Project name, choose or create the directory path in Location, and then select Create.

  5. From the Visual Studio menu bar, select Tools > Get Tools and Features, which opens Visual Studio Installer and displays the Modifying dialog box.

  6. Check whether the .NET desktop development workload is available. If the workload hasn't been installed, select the check box next to it, and then select Modify to start the installation. It may take a few minutes to download and install.

    If the check box next to .NET desktop development is already selected, select Close to exit the dialog box.

    Enable .NET desktop development

  7. Close Visual Studio Installer.

Use NuGet Package Manager to install the Speech SDK

  1. In the Solution Explorer, right-click the helloworld project, and then select Manage NuGet Packages to show the NuGet Package Manager.

    NuGet Package Manager

  2. In the upper-right corner, find the Package Source drop-down box, and make sure that nuget.org is selected.

  3. In the upper-left corner, select Browse.

  4. In the search box, type Microsoft.CognitiveServices.Speech and select Enter.

  5. From the search results, select the Microsoft.CognitiveServices.Speech package, and then select Install to install the latest stable version.

    Install Microsoft.CognitiveServices.Speech NuGet package

  6. Accept all agreements and licenses to start the installation.

    After the package is installed, a confirmation appears in the Package Manager Console window.

You can now move on to Next steps below.

Next steps

Choose your target environment

This guide shows how to install the Speech SDK for Linux

Important

By downloading any of the Speech SDK for Azure Cognitive Services components on this page, you acknowledge its license. See the Microsoft Software License Terms for the Speech SDK.

System requirements

Linux (Ubuntu 16.04, Ubuntu 18.04, Debian 9)

Prerequisites

To complete this quickstart, you'll need:

  • Visual Studio 2019

  • Supported Linux platforms will require certain libraries installed (libssl for secure sockets layer support and libasound2 for sound support). Refer to your distribution below for the commands needed to install the correct versions of these libraries.

    • On Ubuntu:

      sudo apt-get update
      sudo apt-get install build-essential libssl1.0.0 libasound2 wget
      
    • On Debian 9:

      sudo apt-get update
      sudo apt-get install build-essential libssl1.0.2 libasound2 wget
      

Install Speech SDK

The Speech SDK for Linux can be used to build both 64-bit and 32-bit applications. The required libraries and header files can be downloaded as a tar file from https://aka.ms/csspeech/linuxbinary.

Download and install the SDK as follows:

  1. Choose a directory to which the Speech SDK files should be extracted, and set the SPEECHSDK_ROOT environment variable to point to that directory. This variable makes it easy to refer to the directory in future commands. For example, if you want to use the directory speechsdk in your home directory, use a command like the following:

    export SPEECHSDK_ROOT="$HOME/speechsdk"
    
  2. Create the directory if it doesn't exist yet.

    mkdir -p "$SPEECHSDK_ROOT"
    
  3. Download and extract the .tar.gz archive containing the Speech SDK binaries:

    wget -O SpeechSDK-Linux.tar.gz https://aka.ms/csspeech/linuxbinary
    tar --strip 1 -xzf SpeechSDK-Linux.tar.gz -C "$SPEECHSDK_ROOT"
    
  4. Validate the contents of the top-level directory of the extracted package:

    ls -l "$SPEECHSDK_ROOT"
    

    The directory listing should contain the third-party notice and license files, as well as an include directory containing header (.h) files and a lib directory containing libraries.

    Path Description
    license.md License
    ThirdPartyNotices.md Third-party notices.
    REDIST.txt Redistribution notice.
    include The required header files for C and C++
    lib/x64 Native library for x64 required to link your application
    lib/x86 Native library for x86 required to link your application

You can now move on to Next steps below.

Next steps

Choose your target environment

This guide shows how to install the Speech SDK for 64-bit Java 8 JRE.

Note

For the Speech Devices SDK and the Roobo device, see Speech Devices SDK.

Important

By downloading any of the Speech SDK for Azure Cognitive Services components on this page, you acknowledge its license. See the Microsoft Software License Terms for the Speech SDK.

Supported operating systems

  • The Java Speech SDK package is available for these operating systems:
    • Windows: 64-bit only
    • Mac: macOS X version 10.13 or later
    • Linux: 64-bit only on Ubuntu 16.04, Ubuntu 18.04, or Debian 9

Prerequisites

  • Java 8 or JDK 8

  • Eclipse Java IDE (requires Java already installed)

  • Supported Linux platforms will require certain libraries installed (libssl for secure sockets layer support and libasound2 for sound support). Refer to your distribution below for the commands needed to install the correct versions of these libraries.

    • On Ubuntu, run the following commands to install the required packages:

      ```sh
      sudo apt-get update
      sudo apt-get install build-essential libssl1.0.0 libasound2
      ```
      
    • On Debian 9, run the following commands to install the required packages:

      ```sh
      sudo apt-get update
      sudo apt-get install build-essential libssl1.0.2 libasound2
      ```
      
  • On Windows, you need the Microsoft Visual C++ Redistributable for Visual Studio 2019 for your platform. Note that installing this for the first time may require you to restart Windows before continuing with this guide.

Create an Eclipse project and install the Speech SDK

  1. Start Eclipse.

  2. In the Eclipse Launcher, in the Workspace field, enter the name of a new workspace directory. Then select Launch.

    Screenshot of Eclipse Launcher

  3. In a moment, the main window of the Eclipse IDE appears. Close the Welcome screen if one is present.

  4. From the Eclipse menu bar, create a new project by choosing File > New > Project.

  5. The New Project dialog box appears. Select Java Project, and select Next.

    Screenshot of New Project dialog box, with Java Project highlighted

  6. The New Java Project wizard starts. In the Project name field, enter quickstart, and choose JavaSE-1.8 as the execution environment. Select Finish.

    Screenshot of New Java Project wizard

  7. If the Open Associated Perspective? window appears, select Open Perspective.

  8. In the Package explorer, right-click the quickstart project. Choose Configure > Convert to Maven Project from the context menu.

    Screenshot of Package explorer

  9. The Create new POM window appears. In the Group Id field, enter com.microsoft.cognitiveservices.speech.samples, and in the Artifact Id field, enter quickstart. Then select Finish.

    Screenshot of Create new POM window

  10. Open the pom.xml file and edit it.

    • At the end of the file, before the closing tag </project>, create a repositories element with a reference to the Maven repository for the Speech SDK, as shown here:

      <repositories>
        <repository>
          <id>maven-cognitiveservices-speech</id>
          <name>Microsoft Cognitive Services Speech Maven Repository</name>
          <url>https://csspeechstorage.blob.core.windows.net/maven/</url>
        </repository>
      </repositories>
      
    • Also add a dependencies element, with the Speech SDK version 1.7.0 as a dependency:

      <dependencies>
        <dependency>
          <groupId>com.microsoft.cognitiveservices.speech</groupId>
          <artifactId>client-sdk</artifactId>
          <version>1.7.0</version>
        </dependency>
      </dependencies>
      
    • Save the changes.

Next steps

This guide shows how to install the Speech SDK for Python.

Important

By downloading any of the Speech SDK for Azure Cognitive Services components on this page, you acknowledge its license. See the Microsoft Software License Terms for the Speech SDK.

Supported operating systems

  • The Python Speech SDK package is available for these operating systems:
    • Windows: x64 and x86
    • Mac: macOS X version 10.12 or later
    • Linux: Ubuntu 16.04, Ubuntu 18.04, Debian 9 on x64

Prerequisites

  • Supported Linux platforms will require certain libraries installed (libssl for secure sockets layer support and libasound2 for sound support). Refer to your distribution below for the commands needed to install the correct versions of these libraries.

    • On Ubuntu, run the following commands to install the required packages:

      ```sh
      sudo apt-get update
      sudo apt-get install build-essential libssl1.0.0 libasound2
      ```
      
    • On Debian 9, run the following commands to install the required packages:

      ```sh
      sudo apt-get update
      sudo apt-get install build-essential libssl1.0.2 libasound2
      ```
      
  • On Windows, you need the Microsoft Visual C++ Redistributable for Visual Studio 2019 for your platform. Note that installing this for the first time may require you to restart Windows before continuing with this guide.

  • And finally, you'll need Python 3.5 or later. To check your installation, open a command prompt and type the command python --version and check the result. If it's installed properly, you'll get a response "Python 3.5.1" or similar.

Install the Speech SDK using Visual Studio Code

  1. Download and install the latest supported version of Python for your platform, 3.5 or later.

    • Windows users make sure to select "Add Python to your PATH" during the installation process.
  2. Download and install Visual Studio Code.

  3. Open Visual Studio Code and install the Python extension. Select File > Preferences > Extensions from the menu. Search for Python and click Install.

    Install the Python extension

  4. Also from within Visual Studio Code, install the Speech SDK Python package from the integrated command line:

    1. Open a terminal (from the drop-down menus, Terminal > New Terminal)
    2. In the terminal that opens, enter the command python -m pip install azure-cognitiveservices-speech

That's it, you're ready to start coding to the Speech SDK in Python, and can move on to Next steps below. If you are new to Visual Studio Code, refer to the more extensive Visual Studio Code Documentation. For more information about Visual Studio Code and Python, see Visual Studio Code Python tutorial.

Install the Speech SDK using the command line

If you are not using Visual Studio Code, the following command installs the Python package from PyPI for the Speech SDK. For users of Visual Studio Code, skip to the next sub-section.

pip install azure-cognitiveservices-speech

If you are on macOS, you may need to run the following command to get the pip command above to work:

python3 -m pip install --upgrade pip

Once you've successfully used pip to install azure-cognitiveservices-speech, you can use the Speech SDK by importing the namespace into your Python projects. For example:

import azure.cognitiveservices.speech as speechsdk

This is shown in more detail within the code examples listed in Next steps below.

Support and updates

Updates to the Speech SDK Python package are distributed via PyPI and announced in the Release notes. If a new version is available, you can update to it with the command pip install --upgrade azure-cognitiveservices-speech. Check which version is currently installed by inspecting the azure.cognitiveservices.speech.__version__ variable.

If you have a problem, or you're missing a feature, see Support and help options.

Next steps