Class PhraseSpotter.Builder

ru.yandex.speechkit

public  class  PhraseSpotter.Builder 

Class for creating and configuring an object of the PhraseSpotter class.

Methods

Builder(@NonNull final String modelPath, @NonNull final PhraseSpotterListener listener)

Creates an object of the PhraseSpotter.Builder class with mandatory settings.

PhraseSpotterbuild()

Creates an object of the PhraseSpotter class with the passed parameters.

BuildersetAudioSource(@NonNull final AudioSource audioSource)

Sets the audio source (AudioSource).

BuildersetIsLoggingEnabled(boolean value)

Sets the audio logging flag.

StringtoString()

Method Detail

Builder

public Builder (@NonNull final String modelPath, @NonNull final PhraseSpotterListener listener)

Creates an object of the PhraseSpotter.Builder class with mandatory settings.

Parameters:
modelPath

Path to the voice activation model.

listener

Interface for recognition event notification.

build

public PhraseSpotter build ()

Creates an object of the PhraseSpotter class with the passed parameters.

Returns:

An object of the PhraseSpotter class.

setAudioSource

public Builder setAudioSource (@NonNull final AudioSource audioSource)

Sets the audio source (AudioSource).

Default value: AutoStartStopAudioSource.
Parameters:
audioSource

Audio source (AudioSource) that passes an audio for recognition to an object of the PhraseSpotter class.

Returns:

An object of the PhraseSpotter.Builder class.

setIsLoggingEnabled

public Builder setIsLoggingEnabled (boolean value)

Sets the audio logging flag.

Parameters:
value

Audio logging flag. Default value: false. If the parameter is set to true, the PhraseSpotter class object, while running, will send the recorded audio to the server.

Returns:

An object of the PhraseSpotter.Builder class.

toString

public String toString ()