# speech

<a id="speech"></a>

# speech

Voice activity detection over decoded audio, reported as speech events.

## Classes

| Name | Description |
|------|-------------|
| [`SpeechQueue`](https://auscaster.com/icey/docs/api-reference/icy-speech-SpeechQueue.md#speechqueue) | Async queue for decoded audio packets. |
| [`VoiceActivityDetector`](https://auscaster.com/icey/docs/api-reference/icy-speech-VoiceActivityDetector.md#voiceactivitydetector) | Detects speech in decoded audio by its energy and emits speech:start, speech:update and speech:end events. |
| [`AudioRef`](https://auscaster.com/icey/docs/api-reference/icy-speech-AudioRef.md#audioref) | The audio packet an event refers to: its sequence, timing and sample format. |
| [`SpeechEvent`](https://auscaster.com/icey/docs/api-reference/icy-speech-SpeechEvent.md#speechevent) | A speech:start, speech:update or speech:end event, with the source, detector, audio and signal levels that produced it. |
| [`VoiceActivityDetectorConfig`](https://auscaster.com/icey/docs/api-reference/icy-speech-VoiceActivityDetectorConfig.md#voiceactivitydetectorconfig) | Settings for a [VoiceActivityDetector](https://auscaster.com/icey/docs/api-reference/icy-speech-VoiceActivityDetector.md#voiceactivitydetector): the source it reports for, the levels that start and stop speech, how long silence lasts before speech ends, and how often it reports while speech continues. |
| [`VoiceActivityDetectorStats`](https://auscaster.com/icey/docs/api-reference/icy-speech-VoiceActivityDetectorStats.md#voiceactivitydetectorstats) | Counts of packets seen and events emitted, whether speech is active, and the last measured levels. |

## Functions

| Return | Name | Description |
|--------|------|-------------|
| [`Speech_API`](https://auscaster.com/icey/docs/api-reference/speech.md#speech_api)[`AudioRef`](https://auscaster.com/icey/docs/api-reference/icy-speech-AudioRef.md#audioref) | [`makeAudioRef`](#makeaudioref)  |  |
| [`Speech_API`](https://auscaster.com/icey/docs/api-reference/speech.md#speech_api)[`json::Value`](https://auscaster.com/icey/docs/api-reference/icy-json.md#value) | [`toJson`](#tojson-1)  |  |
| [`Speech_API`](https://auscaster.com/icey/docs/api-reference/speech.md#speech_api)[`json::Value`](https://auscaster.com/icey/docs/api-reference/icy-json.md#value) | [`toJson`](#tojson-2)  |  |

---

<a id="makeaudioref"></a>

### makeAudioRef

```cpp
Speech_APIAudioRef makeAudioRef(const av::PlanarAudioPacket & packet, uint64_t sequence = 0, int sampleRateHint = 0)
```

[Defined in src/speech/include/icy/speech/event.h:58](https://github.com/auscaster/icey/blob/main/src/speech/include/icy/speech/event.h#L58)

---

<a id="tojson-1"></a>

### toJson

```cpp
Speech_APIjson::Value toJson(const AudioRef & audio)
```

[Defined in src/speech/include/icy/speech/event.h:61](https://github.com/auscaster/icey/blob/main/src/speech/include/icy/speech/event.h#L61)

---

<a id="tojson-2"></a>

### toJson

```cpp
Speech_APIjson::Value toJson(const SpeechEvent & event)
```

[Defined in src/speech/include/icy/speech/event.h:62](https://github.com/auscaster/icey/blob/main/src/speech/include/icy/speech/event.h#L62)
