> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gladecore.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Step 4: Speech to Text (STT)

> Follow the instructions below to set up and use Speech to Text (STT) capabilities. 

## General Setup

1. Go to ChatUICanvas in the DemoChat Scene. Find STTManager Script.

*Note: if you can't find it, add \[STTManager] script, assign it to \[NPCChatUI].*

<img src="https://mintcdn.com/gladestudio/TF9V8ABRJNNppr0e/images/unity/Unity_STTManagerScript.png?fit=max&auto=format&n=TF9V8ABRJNNppr0e&q=85&s=7c96f79391e5545eeda4e2d849c1d51c" alt="Unity STT Manager Script" width="1020" height="602" data-path="images/unity/Unity_STTManagerScript.png" />

<img src="https://mintcdn.com/gladestudio/TF9V8ABRJNNppr0e/images/unity/Unity_ChatUICanvasSTTManager.png?fit=max&auto=format&n=TF9V8ABRJNNppr0e&q=85&s=f982c71767be1100fb8606a9cf2f4765" alt="Unity Chat UI Canvas STT Manager" width="1009" height="578" data-path="images/unity/Unity_ChatUICanvasSTTManager.png" />

<img src="https://mintcdn.com/gladestudio/TF9V8ABRJNNppr0e/images/unity/Unity_VoiceInputSTTAutoSendRecognizedText.png?fit=max&auto=format&n=TF9V8ABRJNNppr0e&q=85&s=240d270abd89583deccc7f644323a501" alt="Unity Voice Input STT Auto Send Recognized Text" width="1026" height="126" data-path="images/unity/Unity_VoiceInputSTTAutoSendRecognizedText.png" />

2. **Auto Send Recognized Text:** Checked by default. The recognized STT text is sent to the chat automatically.
3. **Disable Text Input While Recording**: Checked by default. The user cannot type in the chat while recording.

## STT Manager Settings

1. Check Enable Voice Input to enable STT

<img src="https://mintcdn.com/gladestudio/TF9V8ABRJNNppr0e/images/unity/Unity_STTSettingsEnableVoiceInput.png?fit=max&auto=format&n=TF9V8ABRJNNppr0e&q=85&s=36696c67060e310c2b718b464db952ce" alt="Unity STT Settings Enable Voice Input" width="1153" height="98" data-path="images/unity/Unity_STTSettingsEnableVoiceInput.png" />

2. Model Path
   * Download whisper models from [<u>https://huggingface.co/ggerganov/whisper.cpp/tree/main</u>](https://huggingface.co/ggerganov/whisper.cpp/tree/main)
   * Copy the model file to `/Assets/StreamingAssets/Whisper/`
   * Select the model for STT

<img src="https://mintcdn.com/gladestudio/TF9V8ABRJNNppr0e/images/unity/Unity_WhisperModelSettingsModelPath.png?fit=max&auto=format&n=TF9V8ABRJNNppr0e&q=85&s=5aa1a2f2b689ce5941bfe939c31cbb41" alt="Unity Whisper Model Settings Model Path" width="1019" height="111" data-path="images/unity/Unity_WhisperModelSettingsModelPath.png" />

<img src="https://mintcdn.com/gladestudio/TF9V8ABRJNNppr0e/images/unity/Unity_WhisperModelPathSetGGML.png?fit=max&auto=format&n=TF9V8ABRJNNppr0e&q=85&s=e146fa5886b2c1018128cdf3bdf653c0" alt="Unity Whisper Model Path Set GGML" width="982" height="828" data-path="images/unity/Unity_WhisperModelPathSetGGML.png" />

**Is Models in Streaming Assets**: checked by default so the packaged game includes the Whisper models.

3. Select the Language

Translate To English is checked by default.

*Note: If set to Auto, Whisper may mis-detect the spoken language and produce garbled output.*

<img src="https://mintcdn.com/gladestudio/TF9V8ABRJNNppr0e/images/unity/Unity_STTLanguageSelectEnglish.png?fit=max&auto=format&n=TF9V8ABRJNNppr0e&q=85&s=3d60079fb6501d0f6293361359ca9a24" alt="Unity STT Language Select English" width="1097" height="617" data-path="images/unity/Unity_STTLanguageSelectEnglish.png" />

4. Select Voice Input Key

Press and hold the voice input key to record. Release to end recording.

<img src="https://mintcdn.com/gladestudio/TF9V8ABRJNNppr0e/images/unity/Unity_STTSelectVoiceInputKey.png?fit=max&auto=format&n=TF9V8ABRJNNppr0e&q=85&s=a65303b3670d80a5a838cff3564cdec3" alt="Unity STT Select Voice Input Key" width="1044" height="45" data-path="images/unity/Unity_STTSelectVoiceInputKey.png" />

5. Microphone Settings

<img src="https://mintcdn.com/gladestudio/TF9V8ABRJNNppr0e/images/unity/Unity_STTMicrophoneSettings.png?fit=max&auto=format&n=TF9V8ABRJNNppr0e&q=85&s=1c935097dd58e2f61c6bbfdef50c646a" alt="Unity STT Microphone Settings" width="1007" height="276" data-path="images/unity/Unity_STTMicrophoneSettings.png" />

6. Debug

<img src="https://mintcdn.com/gladestudio/TF9V8ABRJNNppr0e/images/unity/Unity_STTDebugLogSTT.png?fit=max&auto=format&n=TF9V8ABRJNNppr0e&q=85&s=543f8428bace0f4c6b22920116e777b6" alt="Unity STT Debug Log STT" width="1018" height="70" data-path="images/unity/Unity_STTDebugLogSTT.png" />
