Skip to main content

Introduction

SpeechToText SDK Overview​

The SpeechToText SDK provides an API for converting speech to text. Third-party apps integrate with the Speech Service of Pleos Connect through the SpeechToText SDK. When a third-party app requests speech recognition, the Speech Service converts the recognized speech to text and returns the recognition result to the app.

Does not provide voice command functionality

SpeechToText converts a user utterance into text, such as "Play some music", and returns that text. It does not execute real actions, such as starting music playback. To execute app features based on recognized commands, see Gleo Interface.

SDK version

This guide is based on SpeechToText SDK v3.3.1.

Speech recognition modes​

The SpeechToText SDK provides the following three speech recognition modes.

  • HYBRID: The default mode. It prioritizes server-based streaming speech recognition and automatically switches to the On-device engine if the network connection fails. App registration with My Project credentials from Pleos Playground is required.
  • SERVER: Uses server-based speech recognition. It requires a network connection and app registration. If the network connection fails, it does not switch to the On-device engine.
  • ON_DEVICE: Runs speech recognition on the vehicle's On-device engine. It does not require a network connection, and app registration is not required when using this mode only.

Entry point​

The ai.pleos.playground.stt.SpeechToText class is the entry point for accessing SpeechToText SDK functionality. Create an instance by passing the application Context and recognition Mode to the constructor. If you omit Mode, the SDK uses HYBRID.

A typical usage sequence is as follows.

  1. Create a SpeechToText instance.
  2. Initialize the SDK with initialize().
  3. Register a ResultListener with addListener().
  4. If needed, set the recognition language/region with setLocale().
  5. If using server-based recognition modes (HYBRID, SERVER), complete app registration.
  6. Start speech recognition with request().
  7. When recognition is done, call stop().
  8. After use, remove listeners with removeListener() and release resources with release().

Example: Create SpeechToText instance​

import ai.pleos.playground.stt.SpeechToText
import ai.pleos.playground.stt.constant.Mode

val speechToText = SpeechToText(applicationContext, Mode.HYBRID)

Emulator setup​

To use the SpeechToText SDK, install the Pleos Connect Emulator in Android Studio and configure an AVD.

  1. Check software development environment requirements
  2. Install the Pleos Connect Emulator
  3. Create and run an AVD
  4. Set up Pleos Connect Virtual Console
  5. Configure microphone access
  6. Configure cold boot

Next steps​

  1. Importing SpeechToText SDK
  2. Declaring Permission
  3. SDK Initialization and Release
  4. Result Listeners
  5. App Registration
  6. Starting and Stopping Speech Recognition
  7. Sending Audio Data
  8. Error Codes
  9. SpeechToText API Reference