Skip to content

Latest commit

 

History

History

translate-speech-to-text

README.md

Quickstart: Translate speech in Java on Windows, macOS or Linux

This sample demonstrates how to translate speech with the Speech SDK for Java on Windows, macOS or Linux. See the accompanying article on the SDK documentation page which describes how to build this sample from scratch in Eclipse.

Note: The Speech SDK for the JRE currently supports the Windows x64 platform, macOS x64 (10.14 or later), macOS M1 arm64 (11.0 or later), and specific Linux distributions and target architectures.

Option 1: Run the Sample Easily in Visual Studio Code (Recommended)

This is the easiest way to get started. The Azure AI Speech Toolkit extension automates setup, environment configuration, build, and run.

  • Install Azure AI Speech Toolkit extension in VS Code.
  • In extension's panel, click View Samples and download this sample from sample gallery.
  • From the Command Palette (Ctrl+Shift+P / Cmd+Shift+P), run:
    • Azure AI Speech Toolkit: Configure Azure Speech Resources to select a speech resource (one-time setup).
    • Azure AI Speech Toolkit: Configure and Setup the Sample App to prepare the project (one-time setup).
    • Azure AI Speech Toolkit: Build the Sample App to compile the code.
    • Azure AI Speech Toolkit: Run the Sample App to run the sample.

Option 2: Manual Setup and Run (Advanced)

Follow these steps if you prefer not to use VS Code.

Prerequisites

1. This sample has not been verified with Eclipse on ARM platforms.

Build the sample

> Note: more detailed step-by-step instructions are available here.

  • By downloading the Microsoft Cognitive Services Speech SDK when building this sample, you acknowledge its license, see Speech SDK license agreement.
  • Download the sample code to your development PC.
  • Create an empty workspace in Eclipse and import the folder containing this sample as a project into your workspace.
  • Edit the Main source:
    • Replace the string YourSubscriptionKey with your own subscription key.
    • Replace the string YourEndpointUrl with the endpoint for your Speech resource. You can find this endpoint in the Azure Portal under your Speech resource's "Keys and Endpoint" section (e.g., https://my-speech-resource.cognitiveservices.azure.com/).
  • Save the modified file.

Run the sample

  • Press F11, or select Run > Debug.

References