How to use the SpeechDetector Module

I am trying to use SpeechDetector Module in Speech framework along with SpeechTranscriber. and it is giving me an error

Cannot convert value of type 'SpeechDetector' to expected element type 'Array<any SpeechModule>.ArrayLiteralElement' (aka 'any SpeechModule')

Below is how I am using it

                let speechDetector = Speech.SpeechDetector()
            
                let transcriber = SpeechTranscriber(locale: Locale.current,
                                                        transcriptionOptions: [],
                                                        reportingOptions: [.volatileResults],
                                                        attributeOptions: [.audioTimeRange])
                speechAnalyzer = try SpeechAnalyzer(modules: [transcriber,speechDetector])

Same issue here. Root cause is in the current SDK types. SpeechAnalyzer expects an array of any SpeechModule:

// SpeechAnalyzer.swift (SDK)
public convenience init(modules: [any SpeechModule], options: SpeechAnalyzer.Options? = nil)

SpeechTranscriber does conform (indirectly) to SpeechModule:

// SpeechTranscriber.swift (SDK)
@available(macOS 26.0, iOS 26.0, *)
final public class SpeechTranscriber : LocaleDependentSpeechModule {
    public convenience init(locale: Locale, preset: SpeechTranscriber.Preset)
}

…but SpeechDetector is a final class with no SpeechModule conformance:

// SpeechDetector.swift (SDK)
@available(macOS 26.0, iOS 26.0, *)
final public class SpeechDetector {
    public init(detectionOptions: SpeechDetector.DetectionOptions, reportResults: Bool)
    public convenience init()
}

Apple’s docs say we should be able to do:

let transcriber = SpeechTranscriber(...)
let speechDetector = SpeechDetector()
let analyzer = SpeechAnalyzer(modules: [speechDetector, transcriber])
  • but currently that’s impossible, since SpeechDetector doesn’t conform to SpeechModule (and it’s final, so we can’t adapt it ourselves).

Workaround: initialize SpeechAnalyzer with the transcriber only, and implement voice-activation externally (e.g., auto-stop on inactivity). Waiting on clarification/fix from Apple whether SpeechDetector is intended to conform to SpeechModule in iOS 26.

Waiting on clarification/fix from Apple whether SpeechDetector is intended to conform to SpeechModule in iOS 26.

It was intended to conform, yes; this will be fixed in the next point update to Tahoe.

(and other platforms, including iOS)

This is how I worked around it:

if options.enableVAD {
    if let detector = SpeechDetector(detectionOptions: .init(sensitivityLevel: .medium), reportResults: false) as? (any SpeechModule) {
        self.modules.append(detector)
    } else {
        throw SystemTranscriberError.failedToStart("could not create SpeechDetector")
    }
}
How to use the SpeechDetector Module
 
 
Q