<!--
{
  "availability" : [
    "iOS: 26.0.0 -",
    "iPadOS: 26.0.0 -",
    "macCatalyst: 26.0.0 -",
    "macOS: 26.0.0 -",
    "tvOS: 26.0.0 -",
    "visionOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Speech",
  "identifier" : "/documentation/Speech/SpeechDetector",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Speech"
    ],
    "preciseIdentifier" : "s:6Speech0A8DetectorC"
  },
  "title" : "SpeechDetector"
}
-->

# SpeechDetector

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

```
final class SpeechDetector
```

## 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`](/documentation/Speech/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(_:)`](/documentation/Speech/SpeechAnalyzer/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 ``doc://com.apple.speech/documentation/Speech/SpeechTranscriber`` or ``doc://com.apple.speech/documentation/Speech/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 ``doc://com.apple.speech/documentation/Speech/SpeechDetector/SensitivityLevel``. While ``doc://com.apple.speech/documentation/Speech/SpeechDetector/SensitivityLevel/medium`` is recommended for most use cases, the value of these tradeoffs will be context-specific.

## Topics

### Creating a detector

[`convenience init()`](/documentation/Speech/SpeechDetector/init())

Creates a speech detector with default settings.

[`init(detectionOptions: SpeechDetector.DetectionOptions, reportResults: Bool)`](/documentation/Speech/SpeechDetector/init(detectionOptions:reportResults:))

Creates a speech detector.

[`struct DetectionOptions`](/documentation/Speech/SpeechDetector/DetectionOptions)

Allows clients to customize an instance of a speech detector.

[`enum SensitivityLevel`](/documentation/Speech/SpeechDetector/SensitivityLevel)

Determines how “aggressive” the voice activity detection (VAD) model will be.

### Checking audio format support

### Getting results

[`var results: some Sendable & AsyncSequence<SpeechDetector.Result, any Error>`](/documentation/Speech/SpeechDetector/results)

The asynchronous sequence of speech detection results.

[`struct Result`](/documentation/Speech/SpeechDetector/Result)

A result from the speech detector. Please note, these must be enabled via [`init(detectionOptions:reportResults:)`](/documentation/Speech/SpeechDetector/init(detectionOptions:reportResults:)) and currently only support error handling from the VAD model.

## Relationships

### Conforms To

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`SpeechModule`](/documentation/Speech/SpeechModule)

[`Sendable`](/documentation/Swift/Sendable)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)