ActivityDetectionConfig
public struct ActivityDetectionConfig : SendableConfigures the model's automatic detection of user activity.
Public Preview: This API is a public preview and may be subject to change.
Seealso
RealtimeInputConfig
-
How sensitive the model interprets speech activity.
Public Preview: This API is a public preview and may be subject to change.
Declaration
Swift
public enum Sensitivity : Sendable -
Creates a new
ActivityDetectionConfigvalue.Declaration
Swift
public init(startSensitivity: Sensitivity? = nil, endSensitivity: Sensitivity? = nil, prefixPadding: TimeInterval? = nil, silenceDuration: TimeInterval? = nil)Parameters
startSensitivityDetermines how likely the start of speech is detected.
endSensitivityDetermines how likely the end of speech is detected.
prefixPaddingHow long detected speech should be present before start-of-speech is committed.
silenceDurationHow long silence (or non-speech) should be present before end-of-speech is committed.
-
Creates a new
ActivityDetectionConfigvalue.This method uses
Durationfor timing related properties instead ofTimeInterval. See the "See Also" section for the alternative initializer if you don't have access to theDurationAPI.Declaration
Swift
@available(iOS 16.0, macOS 13.0, tvOS 16.0, watchOS 9.0, *) public init(startSensitivity: Sensitivity? = nil, endSensitivity: Sensitivity? = nil, prefixPadding: Duration? = nil, silenceDuration: Duration? = nil)Parameters
startSensitivityDetermines how likely the start of speech is detected.
endSensitivityDetermines how likely the end of speech is detected.
prefixPaddingHow long detected speech should be present before start-of-speech is committed.
silenceDurationHow long silence (or non-speech) should be present before end-of-speech is committed.
-
Disables automatic activity detection.
When automatic activity detection is enabled, the model will interpret detected voices and text as the start of activity.
When automatic activity detection is disabled, the user must send activity signals manually.
Seealso
sendStartActivityRealtime()Seealso
sendStopActivityRealtime()Declaration
Swift
public static func disabled() -> ActivityDetectionConfig