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.
- A subscription key for the Speech service. See Try the speech service for free.
- A PC (Windows x64 or a supported Linux distribution) or Mac (macOS 10.14 or later) capable to run Eclipse,[1] with a working microphone.
- Java 8 or 11 JRE/JDK.
- Version 4.8 of Eclipse, 64-bit.[1]
- On Linux, see the Linux platform requirements for installing the required dependencies.
1. This sample has not been verified with Eclipse on ARM platforms.
> 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
YourServiceRegion
with the service region of your subscription. For example, replace withwestus
if you are using the 30-day free trial subscription.
- Replace the string
- Save the modified file.
- Press F11, or select Run > Debug.