Breadcrumbs

AsrModule

The AsrModule class handles speech recognition features, including setting the spoken language and attempting to identify a user's language.

Methods

public void SetLanguage(string language)

  • Description: Sets the expected language for speech recognition. This uses the "amazon" ASR service by default.

  • Parameters:

    • string language: The language code (e.g., 'en-US').

public void IdentifyLanguage(string languageHints, int? timeout)

  • Description: Tries to identify the speaker's language within a specified timeframe. The system requires at least 5 seconds of constant voice input. A successful identification or a timeout will be reported via the AsrMessage event.

  • Parameters:

    • string languageHints: A comma-separated list of potential language codes (e.g., 'en-US,de-DE,fr-FR').

    • int? timeout: The maximum duration in seconds for the identification process.