Skip to main content
Version: 0.7.x

Interface: TextToSpeechStreamingInput

Defined in: packages/react-native-executorch/src/types/tts.ts:156

Text to Speech streaming input definition

Streaming mode in T2S is synchronized by passing specific callbacks executed at given moments of the streaming. Actions such as playing the audio should happen within the onNext callback. Callbacks can be both synchronous or asynchronous.

Extends​

Properties​

onBegin()?​

optional onBegin: () => void | Promise<void>

Defined in: packages/react-native-executorch/src/types/tts.ts:157

Called when streaming begins

Returns​

void | Promise<void>


onEnd()?​

optional onEnd: () => void | Promise<void>

Defined in: packages/react-native-executorch/src/types/tts.ts:159

Called when streaming ends

Returns​

void | Promise<void>


onNext()?​

optional onNext: (audio) => void | Promise<void>

Defined in: packages/react-native-executorch/src/types/tts.ts:158

Called after each audio chunk gets calculated.

Parameters​

audio​

Float32Array

Returns​

void | Promise<void>


speed?​

optional speed: number

Defined in: packages/react-native-executorch/src/types/tts.ts:90

optional speed argument - the higher it is, the faster the speech becomes

Inherited from​

TextToSpeechInput.speed


text​

text: string

Defined in: packages/react-native-executorch/src/types/tts.ts:89

a text to be spoken

Inherited from​

TextToSpeechInput.text