ActivityDetectionConfig.Builder

class ActivityDetectionConfig.Builder


Builder for creating an ActivityDetectionConfig.

Summary

Public constructors

Public properties

ActivityDetectionConfig.Sensitivity?

Determines how likely the end of speech is detected.

Int?

How long (in milliseconds) detected speech should be present before start-of-speech is committed.

Int?

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

ActivityDetectionConfig.Sensitivity?

Determines how likely the start of speech is detected.

Public constructors

Builder

Builder()

Public functions

build

fun build(): ActivityDetectionConfig

Creates a new ActivityDetectionConfig with the configured options.

setPrefixPaddingMs

fun setPrefixPaddingMs(paddingMs: Int): ActivityDetectionConfig.Builder

Sets prefixPaddingMs in milliseconds.

setSilenceDurationMs

fun setSilenceDurationMs(durationMs: Int): ActivityDetectionConfig.Builder

Sets silenceDurationMs in milliseconds.

Public properties

endSensitivity

var endSensitivity: ActivityDetectionConfig.Sensitivity?

Determines how likely the end of speech is detected.

prefixPaddingMs

var prefixPaddingMs: Int?

How long (in milliseconds) detected speech should be present before start-of-speech is committed.

The lower this value, the more sensitive the start-of-speech detection is and the shorter the speech that can be recognized. However, this also increases the probability of false positives.

silenceDurationMs

var silenceDurationMs: Int?

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

The larger this value, the longer speech gaps can be without interrupting the user's activity, but this will increase the model's latency.

startSensitivity

var startSensitivity: ActivityDetectionConfig.Sensitivity?

Determines how likely the start of speech is detected.