.. Generated automatically by doc/tools/makerst.py in Godot's source tree. .. DO NOT EDIT THIS FILE, but the doc/base/classes.xml source instead. .. _class_STTRunner: STTRunner ========= **Inherits:** :ref:`Node` **<** :ref:`Object` **Category:** Core Brief Description ----------------- Uses STT (Speech to Text) to identify keywords spoken by the user. Member Functions ---------------- +------------------------------+----------------------------------------------------------------------------------------------------------+ | :ref:`Object` | :ref:`get_config` **(** **)** const | +------------------------------+----------------------------------------------------------------------------------------------------------+ | :ref:`Object` | :ref:`get_queue` **(** **)** const | +------------------------------+----------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_rec_buffer_size` **(** **)** | +------------------------------+----------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_run_error` **(** **)** | +------------------------------+----------------------------------------------------------------------------------------------------------+ | void | :ref:`reset_run_error` **(** **)** | +------------------------------+----------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`running` **(** **)** | +------------------------------+----------------------------------------------------------------------------------------------------------+ | void | :ref:`set_config` **(** :ref:`Object` stt_config **)** | +------------------------------+----------------------------------------------------------------------------------------------------------+ | void | :ref:`set_queue` **(** :ref:`Object` stt_queue **)** | +------------------------------+----------------------------------------------------------------------------------------------------------+ | void | :ref:`set_rec_buffer_size` **(** :ref:`int` size **)** | +------------------------------+----------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`start` **(** **)** | +------------------------------+----------------------------------------------------------------------------------------------------------+ | void | :ref:`stop` **(** **)** | +------------------------------+----------------------------------------------------------------------------------------------------------+ Numeric Constants ----------------- - **DEFAULT_REC_BUFFER_SIZE** = **2048** --- Microphone recorder default buffer size. Description ----------- Responsible for running speech recognition itself, identifying keywords spoken by the user. Member Function Description --------------------------- .. _class_STTRunner_get_config: - :ref:`Object` **get_config** **(** **)** const Returns the :ref:`STTConfig` object containing recognition variables, or ``null`` if not previously set. .. _class_STTRunner_get_queue: - :ref:`Object` **get_queue** **(** **)** const Returns the :ref:`STTQueue` that stores recognized keywords, or ``null`` if not previously set. .. _class_STTRunner_get_rec_buffer_size: - :ref:`int` **get_rec_buffer_size** **(** **)** Returns the microphone recorder buffer size used for speech recognition. .. _class_STTRunner_get_run_error: - :ref:`int` **get_run_error** **(** **)** Returns the :ref:`STTError` value that depicts how the previously running speech recognition thread has ended. It can be one of the following values: - ``OK`` - ``REC_START_ERR`` - ``REC_STOP_ERR`` - ``UTT_START_ERR`` - ``UTT_RESTART_ERR`` - ``AUDIO_READ_ERR`` If no thread was previously run, returns ``OK``. .. _class_STTRunner_reset_run_error: - void **reset_run_error** **(** **)** Resets the :ref:`STTError` value that depicts how the previously running speech recognition thread has ended, setting its value to ``OK``. .. _class_STTRunner_running: - :ref:`bool` **running** **(** **)** Returns ``true`` if the speech recognition thread is active, or ``false`` otherwise. .. _class_STTRunner_set_config: - void **set_config** **(** :ref:`Object` stt_config **)** Sets the :ref:`STTConfig` object containing recognition variables. If the speech recognition thread is currently running, it will be stopped. .. _class_STTRunner_set_queue: - void **set_queue** **(** :ref:`Object` stt_queue **)** Sets the :ref:`STTQueue` that stores recognized keywords. If the speech recognition thread is already running, it will be stopped. .. _class_STTRunner_set_rec_buffer_size: - void **set_rec_buffer_size** **(** :ref:`int` size **)** Sets the microphone recorder buffer size used for speech recognition as the specified value. Must be > 0. If the speech recognition thread is currently running, it will be stopped. .. _class_STTRunner_start: - :ref:`int` **start** **(** **)** Creates a thread to repeatedly listen to keywords. The thread can be stopped with :ref:`stop`. If :ref:`start` was previously called, the current thread is halted and a new recognition, with the specified arguments, is created. Returns one of the following :ref:`STTError` values: - ``OK`` - ``UNDEF_CONFIG_ERR`` - ``UNDEF_QUEUE_ERR`` **Note:** To check for an error that occurred and stopped the thread, see :ref:`get_last_error`. .. _class_STTRunner_stop: - void **stop** **(** **)** Stops the thread currently doing speech recognition. If :ref:`start` wasn't called previously, this function does nothing.