---
title: SpeechDetector
framework: speech
role: symbol
role_heading: Class
path: speech/speechdetector
---

# SpeechDetector

A module that performs a voice activity detection (VAD) analysis.

## Declaration

```swift
final class SpeechDetector
```

## Overview

Overview This module asks “is there speech?” and provides you with the ability to gate transcription by the presence of voices, saving power otherwise used by attempting to transcribe what is likely to be silence. To enable voice activated transcription, initialize a SpeechDetector module. Like any other module, it can be set when first initializing SpeechAnalyzer: let transcriber = SpeechTranscriber(..) let speechDetector = SpeechDetector() let analyzer = SpeechAnalyzer(.., modules: [speechDetector, transcriber]) or later on with setModules(_:): let analyzer = SpeechAnalyzer(..) let transcriber = SpeechTranscriber(..) let speechDetector = SpeechDetector() try await analyzer.setModules([transcriber, speechDetector]) important: This module only functions in conjunction with a SpeechTranscriber or DictationTranscriber module. note: For certain use cases, such as those with a lot of silence, it might be tempting to always enable voice activated transcription. But if the model drops audio that does contain speech, there could be a tradeoff between the power being saved by always having VAD enabled and potentially lower accuracy transcriptions. You can set the aggressiveness of the VAD model with SpeechDetector.SensitivityLevel. While SpeechDetector.SensitivityLevel.medium is recommended for most use cases, the value of these tradeoffs will be context-specific.

## Topics

### Creating a detector

- [init()](speech/speechdetector/init().md)
- [init(detectionOptions:reportResults:)](speech/speechdetector/init(detectionoptions:reportresults:).md)
- [SpeechDetector.DetectionOptions](speech/speechdetector/detectionoptions.md)
- [SpeechDetector.SensitivityLevel](speech/speechdetector/sensitivitylevel.md)

### Getting results

- [results](speech/speechdetector/results.md)
- [SpeechDetector.Result](speech/speechdetector/result.md)

## Relationships

### Conforms To

- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)
- [SpeechModule](speech/speechmodule.md)

## See Also

### Modules

- [SpeechTranscriber](speech/speechtranscriber.md)
- [DictationTranscriber](speech/dictationtranscriber.md)
- [SpeechModule](speech/speechmodule.md)
- [LocaleDependentSpeechModule](speech/localedependentspeechmodule.md)
