# Voice Command

### [![Response_Gadget_EquipToUser.png](https://simlab-soft.com/help/uploads/images/gallery/2024-08/response-gadget-equiptouser.png)](https://simlab-soft.com/help/uploads/images/gallery/2024-08/response-value-number-add.png) Voice Command Recognized 

![Ceiling Node.png](https://simlab-soft.com/help/uploads/images/gallery/2024-09/scaled-1680-/ba6image.png)

The **Voice Command Recognized event** is used to activate a response when the user says a specific command. This event listens for predefined voice commands and triggers the associated actions or responses within the VR environment upon recognizing the command.

#### Example

![image.png](https://simlab-soft.com/help/uploads/images/gallery/2024-09/scaled-1680-/Dkrimage.png)

In this example, a new voice command named "Door Open" is created by accessing the Voice Command section from the Interaction menu and adding the command in the Voice Commands window.

![image.png](https://simlab-soft.com/help/uploads/images/gallery/2024-09/scaled-1680-/QIFimage.png)

The **Voice Command Recognized** **event** is used to link the newly created "Door Open" command. When the user says "Open the door", the door open sequence is triggered and plays.

---

### Voice Command Test

Listens for a spoken voice command and reacts when someone in your scene says one.

#### What it does

This node waits and listens. Whenever a person in your VR scene speaks a voice command out loud, the node fires on its own — you don’t need anything to trigger it. Each time it fires, it tells you the exact words that were spoken and which user said them, so you can respond to what they asked for.

The node stays active only while its **Enable** input is true. Set **Enable** to false whenever you want to stop listening for voice commands.

#### Inputs

<table id="bkmrk-port-type-what-to-co"><thead><tr><th style="white-space: nowrap;">Port</th><th style="white-space: nowrap;">Type</th><th>What to connect</th></tr></thead><tbody><tr><td style="white-space: nowrap;">**Enable**</td><td style="white-space: nowrap;">True / false</td><td>While this is true the node is listening for voice commands; set it to false to switch the listening off. Leave it true to keep responding to spoken commands.</td></tr></tbody></table>

#### Outputs

<table id="bkmrk-port-type-what-you-g"><thead><tr><th style="white-space: nowrap;">Port</th><th style="white-space: nowrap;">Type</th><th>What you get</th></tr></thead><tbody><tr><td style="white-space: nowrap;">**Execute**</td><td style="white-space: nowrap;">Trigger</td><td>Fires each time a voice command is spoken. Wire this to whatever should happen in response.</td></tr><tr><td style="white-space: nowrap;">**Command**</td><td style="white-space: nowrap;">Text</td><td>The words that were spoken, as text. Use this to decide how to react to what was said.</td></tr><tr><td style="white-space: nowrap;">**User**</td><td style="white-space: nowrap;">User</td><td>The person who spoke the command, so you can respond to that specific user.</td></tr></tbody></table>

#### Example

<table id="bkmrk-enable-input-true-co"><tbody><tr><td>**Enable** input</td><td>`true`</td></tr><tr><td>**Command** output</td><td>`open the door`</td></tr><tr><td>**User** output</td><td>The trainee who spoke the command</td></tr></tbody></table>

#### Tips

- Connect the **Command** output to a node that compares text, so you can run different actions for different spoken phrases.
- If you want voice commands active only during a certain part of your scene, wire a true/false value into **Enable** and switch it off when that part is over.