ActivityDetectionConfig.Builder

public final class ActivityDetectionConfig.Builder


Builder for creating an ActivityDetectionConfig.

Summary

Public fields

final ActivityDetectionConfig.Sensitivity

Determines how likely the end of speech is detected.

final Integer

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

final Integer

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

final ActivityDetectionConfig.Sensitivity

Determines how likely the start of speech is detected.

Public constructors

Public fields

endSensitivity

public final ActivityDetectionConfig.Sensitivity endSensitivity

Determines how likely the end of speech is detected.

prefixPaddingMs

public final Integer prefixPaddingMs

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

public final Integer silenceDurationMs

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

public final ActivityDetectionConfig.Sensitivity startSensitivity

Determines how likely the start of speech is detected.

Public constructors

Builder

public Builder()

Public methods

build

public final @NonNull ActivityDetectionConfig build()

Creates a new ActivityDetectionConfig with the configured options.

setPrefixPaddingMs

public final @NonNull ActivityDetectionConfig.Builder setPrefixPaddingMs(int paddingMs)

Sets prefixPaddingMs in milliseconds.

setSilenceDurationMs

public final @NonNull ActivityDetectionConfig.Builder setSilenceDurationMs(int durationMs)

Sets silenceDurationMs in milliseconds.