FirebaseAILogic Framework Reference

ActivityDetectionConfig

public struct ActivityDetectionConfig : Sendable

Configures the model's automatic detection of user activity.

Public Preview: This API is a public preview and may be subject to change.

  • 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 ActivityDetectionConfig value.

    Declaration

    Swift

    public init(startSensitivity: Sensitivity? = nil,
                endSensitivity: Sensitivity? = nil,
                prefixPadding: TimeInterval? = nil,
                silenceDuration: TimeInterval? = nil)

    Parameters

    startSensitivity

    Determines how likely the start of speech is detected.

    endSensitivity

    Determines how likely the end of speech is detected.

    prefixPadding

    How long detected speech should be present before start-of-speech is committed.

    silenceDuration

    How long silence (or non-speech) should be present before end-of-speech is committed.

  • Creates a new ActivityDetectionConfig value.

    This method uses Duration for timing related properties instead of TimeInterval. See the "See Also" section for the alternative initializer if you don't have access to the Duration API.

    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

    startSensitivity

    Determines how likely the start of speech is detected.

    endSensitivity

    Determines how likely the end of speech is detected.

    prefixPadding

    How long detected speech should be present before start-of-speech is committed.

    silenceDuration

    How 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.

    Declaration

    Swift

    public static func disabled() -> ActivityDetectionConfig