Skip to content

Latest commit

 

History

History
50 lines (37 loc) · 3.03 KB

File metadata and controls

50 lines (37 loc) · 3.03 KB

Quickstart: Using virtual assistant (Preview) in Java on Windows or Linux (Ubuntu 16.04, Ubuntu 18.04, Debian 9)

This sample demonstrates how to recognize speech for custom voice-first virtual assistants (Preview) and receive activity responses. 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 only the Windows x64 platform, macOS 10.13 or later, and Linux (Ubuntu 16.04 x64, Ubuntu 18.04 x64, Debian 9 x64).

Prerequisites

  • A subscription key for the Speech service. See Try the speech service for free.

  • A PC (Windows x64, Ubuntu 16.04/18.04 x64) capable to run Eclipse, with a working microphone.

  • 64-bit JRE/JDK for Java 8.

  • Version 4.8 of Eclipse, 64-bit.

  • A pre-configured bot created using Bot Framework version 4.2 or above. See here for steps on how to create a bot. The bot would need to subscribe to the new "Direct Line Speech" channel to receive voice inputs.

  • On Ubuntu 16.04 or 18.04, run the following commands for the installation of required packages:

    sudo apt-get update
    sudo apt-get install libssl1.0.0 libasound2
  • On Debian 9, run the following commands for the installation of required packages:

    sudo apt-get update
    sudo apt-get install libssl1.0.2 libasound2

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 YourServiceRegion with the service region of your subscription.

      Note: In preview, the Direct Line Speech channel currently supports only the westus2 region.

    • Replace the string YourChannelSecret with the secret created when you subscribed your bot to the Direct Line Speech channel.
  • Save the modified file.

Run the sample

  • Press F11, or select Run > Debug.

References