Quickstart: Create a project

In this quickstart, you'll create an empty project for your preferred programming language that you'll use to complete a quickstart or create an application.

Choose your target environment

To create a Visual Studio project for Windows development, you need to create the project, set up Visual Studio for .NET desktop development, install the Speech SDK, and choose the target architecture.

Create the project and add the workload

To start, create the project in Visual Studio, and make sure that Visual Studio is set up for .NET desktop development:

  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.

Install the Speech SDK

The next step is to install the Speech SDK NuGet package, so you can reference it in the code.

  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.

Choose the target architecture

Now, to build and run the console application, create a platform configuration matching your computer's architecture.

  1. From the menu bar, select Build > Configuration Manager. The Configuration Manager dialog box appears.

    Configuration Manager dialog box

  2. In the Active solution platform drop-down box, select New. The New Solution Platform dialog box appears.

  3. In the Type or select the new platform drop-down box:

    • If you're running 64-bit Windows, select x64.
    • If you're running 32-bit Windows, select x86.
  4. Select OK and then Close.

Choose your target environment

For this sample, we'll be compiling with g++, so all you need for an empty project is to create a helloworld.cpp with your favorite text editor.

Choose your target environment

  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.

For the Python-based quickstarts, all you'll need to do is create a file named helloworld.py with your favorite text editor or IDE.

Next steps