Module speech_to_text

Speech to text translation (experimental).

WARNING: totally experimental, no guarantees it will work!

This module provides speech to text translation.

The module requires the Lua lua-cjson and luasec packages.

Info:

  • Copyright: 2011-2018 Chad Phillips
  • Author: Chad Phillips

Actions

speech_to_text_from_file Translates a sound file to text.

Handlers

watson The Watson handler (default).

Tables

speech_to_text Speech to text storage.


Actions

speech_to_text_from_file
Translates a sound file to text.

This action requires that flac is installed and executable by FreeSWITCH.

  • action string speech_to_text_from_file
  • api_key string (Optional) The API key used to access the service.
  • filepath string The full path to the file to translate.
  • storage_area string (Optional) The storage area to store the response in. Defaults to 'speech_to_text'.

Usage:

    {
      action = "speech_to_text_from_file",
      api_key = profile.speech_to_text_app_key,
      filepath = "/tmp/foo.wav",
      storage_area = "foo_to_text",
    }

Handlers

watson
The Watson handler (default).

Uses Watson's Speech to Text service. The service requires a valid developer account and api key, see here for more information.

Usage:

    {
      action = "speech_to_text_from_file",
      handler = "watson",
      -- ...other required params...
      service_uri = "[obtain from service]",
      -- ...other optional params...
      query_parameters = {
        -- key/value pairs to pass as query parameters
      },
      retries = 3,
      retry_wait_seconds = 60,
    }

Tables

speech_to_text
Speech to text storage.

Translations are stored in the specified storage area with the following keys, where X is the chunk number:

A 'status' key is also placed in the storage area, indicating the result of the translation. A value of 0 indicates the translation was successful.

Fields:

  • translation_X The translated text for the chunk.
  • confidence_X The confidence level of the translated chunk, a decimal number in the range of 0 to 1.
generated by LDoc 1.4.6 Last updated 2021-04-08 08:59:59