SpeechTranslatorRequest

public final class SpeechTranslatorRequest


Request for SpeechTranslator.

Summary

Nested types

Builder for SpeechTranslatorRequest.

Public methods

static final @NonNull SpeechTranslatorRequest.Builder

Creates a new Builder that reads audio packets from audioFlow.

final @NonNull Flow<@NonNull TranslationAudio>

the stream of audio packets to translate.

Public methods

builder

public static final @NonNull SpeechTranslatorRequest.Builder builder(@NonNull Flow<@NonNull TranslationAudio> audioFlow)

Creates a new Builder that reads audio packets from audioFlow.

getAudioFlow

public final @NonNull Flow<@NonNull TranslationAudio> getAudioFlow()

the stream of audio packets to translate. Each TranslationAudio carries the locale it was spoken in, which must be either the source or the target locale configured on SpeechTranslatorOptions. Completing the flow signals end of input and ends the session.