# Stop Voice

## Description

```javascript
'stop voice [voice_id] [with [properties]]'
```

The stop voice action will let you stop either all voices currently playing or only one in specific. To learn more about voices, read the[ Play Voice documentation](/documentation/develop/script-actions/play-voice.md).

**Action ID**: `Voice::Stop`

**Reversible**: Yes

**Requires User Interaction**: No

## Parameters

| Name       | Type     | Description                                                                 |
| ---------- | -------- | --------------------------------------------------------------------------- |
| voice\_id  | `string` | Optional. The name of the specific voice you want to stop.                  |
| properties | `string` | Optional. A list of comma separated properties with their respective value. |

### Properties

The following is a comprehensive list of the properties available for you to modify certain behaviors of the stop voice action.

| Name | Type     | Description                                                                                                                                                                  |
| ---- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| fade | `number` | The fade property let's you add a fade out effect to the voice, it accepts a time in seconds, representing how much time you want it to take until the voice volume is zero. |

## Examples

### Stop a specific Voice

The following will stop a specific voice, identified by it's name.

{% tabs %}
{% tab title="Script" %}

```javascript
Monogatari.script ({
    'Start': [
        'play voice dialog_002 with loop',
        'The previous voice will be repeating itself over and over',
        'play voice dialog_001',
        'Two voices are currently playing',
        'stop voice dialog_002',
        'Now the first one has stopped and the second one will stop as soon as it ends',
        'end'
    ]
});
```

{% endtab %}

{% tab title="Voice Assets" %}

```javascript
Monogatari.assets ('voice', {
    'dialog_001': 'dialog_file_1.mp3',
    'dialog_002': 'dialog_file_2.mp3'
});
```

{% endtab %}
{% endtabs %}

### Stop all Voices

The following will stop all sounds currently playing.

{% tabs %}
{% tab title="Script" %}

```javascript
Monogatari.script ({
    'Start': [
        'play voice dialog_002 with loop',
        'The previous voice will be repeating itself over and over',
        'play voice dialog_001',
        'Two voices are currently playing',
        'stop voice',
        'No voice is playing now',
        'end'
    ]
});
```

{% endtab %}

{% tab title="Voice Assets" %}

```javascript
Monogatari.assets ('voice', {
    'dialog_001': 'dialog_file_1.mp3',
    'dialog_002': 'dialog_file_2.mp3'
});
```

{% endtab %}
{% endtabs %}

### Fade Out Effect

The following will stop the voice, and will use a fade out effect to do so. You can also use a fade out effect when stopping all voices.

{% tabs %}
{% tab title="Script" %}

```javascript
Monogatari.script ({
    'Start': [
        'play voice dialog_002 with loop',
        'The previous voice will be repeating itself over and over',
        'play voice dialog_001',
        'Two voices are currently playing',
        'stop voice dialog_002 with fade 12',
        'Now the first will be slowly stopped and the second one will stop as soon as it ends',
        'end'
    ]
});
```

{% endtab %}

{% tab title="Voice Assets" %}

```javascript
Monogatari.assets ('voice', {
    'dialog_001': 'dialog_file_1.mp3',
    'dialog_002': 'dialog_file_2.mp3'
});
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developers.monogatari.io/documentation/develop/script-actions/stop-voice.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
