Talken - Voice Command System

Unlock the power of voice in your game with Talken! Enable real-time voice commands for actions & character movements in English & Spanish. Cross-platform compatible. Transform your gaming experience!

Getting Started

Welcome to the Talken documentation! This guide will walk you through the initial setup and use of Talken, a dynamic voice command Unity asset. You will get an understanding of the asset’s features, including how to set it up, add commands, manage commands, and use both exact match and distance-based match.

Features

Talken includes the following key features:

  • Multilingual Support: Talks support English, Spanish, German, Italian, Japanese, Korean, Portuguese, Russian, Chinese, and Polish languages. Additional languages can be requested.
  • Dynamic Commands: Allows you to add or edit voice commands at runtime.
  • Versatile Compatibility: Runs on Android, iOS, and desktop platforms.
  • Exact Match and Distance-based Match: Provides options for precise matching or general matching based on your needs.
  • Fast Processing: Performance optimized for a smooth user experience.

Open this page and see the available demos directly from the Getting Started window in Window > Talken > Getting Started

How to use

The main component of Talken is a component called VoiceCommandEngine. This is the central component of Talken and is essential for initializing the voice recognition engine.

Adding the VoiceCommandEngine to the Scene

  1. Add VoiceCommandEngine Component: To start using Talken, you must first add the VoiceCommandEngine component to the desired object in your scene.

  2. Initialize VoiceCommandEngine: Once the VoiceCommandEngine component is added to the object, it automatically initializes the voice recognition engine when the scene is loaded.

Defining Voice Commands

Voice commands can be defined in two ways:

  1. Using API Methods: You can programmatically define voice commands using the methods provided by the VoiceCommandEngine component. The following methods are available:

    • AddCommand: Adds a new command to the voice command engine.
    • RemoveCommand: Removes an existing command from the voice command engine.
  2. Using the Inspector UI: You can also define voice commands using the Inspector UI. Simply select the object with the VoiceCommandEngine component and add or remove commands directly through the Inspector.

    Inspector UI Example of defining voice commands using the Inspector UI

Managing Voice Listening State

The state of the voice listening can be controlled using the following methods:

  • StartListening: This method enables the voice recognition engine to start listening for commands.
  • StopListening: This method stops the voice recognition engine from listening to commands.

Optionally, if you want the voice recognition engine to start listening automatically when the scene loads, you can set the StartOnLoad property to true. When StartOnLoad is set to true, the StartListening method is automatically called during the Start() method of the component.

Example Usage

// Adding a voice command programmatically
VoiceCommandEngine.AddCommand("example_command", () => {
    // Code to execute when the command is recognized
});

// Starting the voice recognition engine
VoiceCommandEngine.StartListening();

The VoiceCommandEngine Class

The main class in Talken, this exposes the voice command service and it’s the door to adding commands.

Here’s an overview of its main parts and their functionalities:

Methods

  • void AddCommand(VoiceCommand command): This function enables you to add the specified voice command into the system.
  • void RemoveCommand(VoiceCommand command): This function allows you to remove the specified voice command from the system.
  • IEnumerator StartListening(): This function starts the listening process for incoming voice commands.
  • void StopListening(): Stops listening for commands.

Properties

  • int Max Distance: The maximum distance for a command to be considered a match in case of non-exact command matching.
  • bool Exact Match: A bool field used to decide whether command matching should be exact or distance based.
  • bool StartOnLoad: If the component should start listening once loaded

Exact Match

In the mode of Exact Match, commands are recognized strictly based on their complete and precise utterance. This matching mode is facilitated by enabling the Exact Match variable, demanding a word-for-word match of the commands.

Distance-Based Match

On the other hand, Distance-Based Match employs the Levenshtein distance mechanism to match spoken words. The Max Distance functionality controls the proximity threshold for the command match. For instance, if the command is backward, and the Max Distance is set at 4, then uttering back will be sufficient to execute the command.

Demo Scene

To test out the functionalities of Talken, we provide a Voice commands demo scene. You can either open it from the Getting Started window or from the Scenes folder.

Supported Platforms

Talken supports the following platforms:

Platform Supported
Windows
Android
iOS
MacOS
Linux
WebGL
Oculus
HoloLens

If interested in any other platforms, please reach out.

Supported Languages

Talken supports the following languages. Feel free to reach out if you need additional languages supported.

Language
English
Spanish
French
German
Italian
Japanese
Korean
Portuguese
Russian
Chinese
Polish

Troubleshooting

For any questions, issues or feature requests don’t hesitate to email us at help@leastsquares.io or join the discord. We are always ready to help and have fast response times.



About us

We are a small company focused on building tools for game developers. Send us an email to careers@leastsquares.io if interested in working with us. For any other inquiries, feel free to contact us at hello@leastsquares.io or contact us on the discord





Sign up to our newsletter.

Want to receive news about discounts, new products and updates?