Java Program For Speech Recognition

Posted on  by 

-->

Quickstarts are also available for speech-to-speech-translation and voice-first virtual assistant.

If desired, choose a different programming language and/or environment:

In this article, you create a Java console application by using the Speech SDK. You transcribe speech to text in real time from your PC's microphone. The application is built with the Speech SDK Maven package, and the Eclipse Java IDE (v4.8) on 64-bit Windows, 64-bit Linux (Ubuntu 16.04, Ubuntu 18.04, Debian 9), or on macOS 10.13 or later. It runs on a 64-bit Java 8 runtime environment (JRE).

Java Program For Prime Numbers

Hello and welcome to another tutorial on Java, In this tutorial we’ll be creating a Voice command application using Java and Sphinx4 Speech Recognition Library for Java. If you are new to this Voice Command term, there are many apps that serve as an example in reality. Re: java speech recognition software? 807553 Jul 18, 2002 4:34 PM ( in response to 807553 ) anybody know how to put the new AT&T voices into a Java Program?

Note

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

Prerequisites

This quickstart requires:

  • Operating System: 64-bit Windows, 64-bit Linux (Ubuntu 16.04, Ubuntu 18.04, Debian 9), or macOS 10.13 or later
  • Java 8 or JDK 8
  • An Azure subscription key for the Speech Service. Get one for free.
SpeechJava program for speech recognition

If you're running Linux, make sure these dependencies are installed before starting Eclipse.

Java speech recognition code
  • On Ubuntu:

  • On Debian 9:

If you're running Windows (64-bit), ensure you have installed Microsoft Visual C++ Redistributable for your platform.

Create and configure project

  1. Start Eclipse.

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

  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.

  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.

  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.

  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.

  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:

    • Also add a dependencies element, with the Speech SDK version 1.6.0 as a dependency:

    • Save the changes.

Add sample code

  1. To add a new empty class to your Java project, select File > New > Class.

  2. In the New Java Class window, enter speechsdk.quickstart into the Package field, and Main into the Name field.

  3. Replace all code in Main.java with the following snippet:

  4. Replace the string YourSubscriptionKey with your subscription key.

  5. Replace the string YourServiceRegion with the region associated with your subscription (for example, westus for the free trial subscription).

  6. Save changes to the project.

Build and run the app

Java Program For Fibonacci Series

Press F11, or select Run > Debug.The next 15 seconds of speech input from your microphone will be recognized and logged in the console window.

Next steps

Additional samples, such as how to read speech from an audio file, are available on GitHub.

Java Program For Matrix Multiplication

See also

Coments are closed