Conversation
| await tts.stream({ | ||
| text: '', | ||
| speed: 0.9, | ||
| stopAutomatically: false, | ||
| onNext, | ||
| }); |
There was a problem hiding this comment.
I'm not sure why we need this, can you clarify?
There was a problem hiding this comment.
What exactly do you mean? The 'text' field?
| ::: | ||
|
|
||
| 2. [**`stream({ text, speed })`**](../../06-api-reference/classes/TextToSpeechModule.md#stream): An async generator that yields chunks of audio as they are computed. This is ideal for reducing the "time to first audio" for long sentences. | ||
| 2. [**`stream({ speed, stopAutomatically })`**](../../06-api-reference/classes/TextToSpeechModule.md#stream): An async generator that yields chunks of audio as they are computed. This is ideal for reducing the "time to first audio" for long sentences. In contrast to `forward`, it enables inserting text chunks dynamically into processing buffer with [**`streamInsert(text)`**](../../06-api-reference/classes/TextToSpeechModule.md#streaminsert) and allows stopping generation early with [**`streamStop(instant)`**](../../06-api-reference/classes/TextToSpeechModule.md#streamstop). |
There was a problem hiding this comment.
Any reason why we're ditching the speed param?
| #include <rnexecutorch/data_processing/Sequential.h> | ||
| #include <thread> | ||
|
|
||
| #include <rnexecutorch/Log.h> |
There was a problem hiding this comment.
just a note: it should be a factory from now, see #937
| await this.nativeModule.stream( | ||
| speed, | ||
| stopAutomatically, | ||
| (audio: number[]) => { |
There was a problem hiding this comment.
I think we should return JSTensorViewOut from the native side, so there's less copying going on
| while (!this.streamFinished) { | ||
| if (queue.length > 0) { | ||
| yield queue.shift()!; | ||
| if (finished && queue.length === 0) { | ||
| if (this.streamFinished && queue.length === 0) { | ||
| return; | ||
| } | ||
| continue; | ||
| } | ||
| if (error) throw error; | ||
| if (finished) return; | ||
| if (this.streamFinished) return; |
There was a problem hiding this comment.
why are we checking this.streamFinished twice?
| if (input.text) { | ||
| moduleInstance.streamInsert(input.text); | ||
| } |
There was a problem hiding this comment.
Is this thread safe? This appends to a std::string on a JS thread while a bg thread reads from it, right?
| # Phonemis | ||
| set(LIBS_DIR "${PACKAGE_ROOT}/third-party/android/libs") | ||
| set(PHONEMIS_LIBS | ||
| "${LIBS_DIR}/phonemis/${ANDROID_ABI}/libphonemis.a" | ||
| ) | ||
|
|
There was a problem hiding this comment.
lets follow the convention
add_library(phonemis STATIC IMPORTED)
set_target_properties(phonemis PROPERTIES
IMPORTED_LOCATION "${ANDROID_THIRD_PARTY}/phonemis/${ANDROID_ABI}/libphonemis.a"
)
Description
This pull request introduces a few changes to the Text-to-Speech module:
Introduces a breaking change?
Type of change
Tested on
Testing instructions
To test the Text-to-Speech module, run the set of tests for this module.
To test the new streaming mode and it's integration with text generation models, one can use 'text-to-speech-llm' demo app.
Screenshots
Related issues
#773
#897
Checklist
Additional notes