Skip to content

[RNE Rewrite] feat: add Kokoro TTS pipeline implementation - #1364

Merged
msluszniak merged 7 commits into
rne-rewritefrom
@is/rne-rewrite-kokoro
Aug 19, 2026
Merged

[RNE Rewrite] feat: add Kokoro TTS pipeline implementation#1364
msluszniak merged 7 commits into
rne-rewritefrom
@is/rne-rewrite-kokoro

Conversation

@IgorSwat

Copy link
Copy Markdown
Contributor

Description

What this PR adds:

  • Implementation of the Kokoro (text-to-speech) pipeline for one-way streaming (single input, streamed output)
  • Implementation for boolean DType
  • Demo app for Kokoro model

Introduces a breaking change?

  • Yes
  • No

Type of change

  • Bug fix (change which fixes an issue)
  • New feature (change which adds functionality)
  • Documentation update (improves or adds clarity to existing documentation)
  • Other (chores, tests, code style improvements etc.)

Tested on

  • iOS
  • Android

Testing instructions

Run the dedicated demo app.

Screenshots

Related issues

Checklist

  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have updated the documentation accordingly
  • My changes generate no new warnings

Additional notes

The implementation of the Kokoro pipeline follows strictly the one already done for Supertonic. For this purpose, it got simplified a bit, with the following changes:

  • Duration predictor no longer has 3 specialized input-size methods: instead of 'forward_32', 'forward_64' and 'forward_128' we use one 'forward' for the entire available token range. Costs a little bit worse performance, but gains reduced memory usage.
  • Text partitioning and phonemization are applied in a simple, sequential order. In old Kokoro pipeline they would interleave themselves. In most practical cases it is a meaningless change, although if user passes a very long text in a language where Phonemis does not provide a lexicon (currently only English pipeline does), it can be significant for latency.

@IgorSwat IgorSwat changed the title [RNE Rewrite] [RNE Rewrite] feat: add Kokoro TTS pipeline implementation Aug 17, 2026
@msluszniak msluszniak added the feature PRs that implement a new feature label Aug 17, 2026
@IgorSwat
IgorSwat requested review from barhanc and msluszniak August 17, 2026 07:30
Comment thread packages/react-native-executorch/cpp/core/dtype.cpp Outdated
Comment thread packages/react-native-executorch/cpp/extensions/speech/phonemizer.cpp Outdated
Comment thread packages/react-native-executorch/cpp/extensions/speech/phonemizer.h Outdated
Comment thread packages/react-native-executorch/src/core/schema.ts Outdated
@IgorSwat
IgorSwat force-pushed the @is/rne-rewrite-kokoro branch from 98c063d to 5d01060 Compare August 17, 2026 09:35
Comment thread packages/react-native-executorch/android/CMakeLists.txt Outdated
Comment thread packages/react-native-executorch/cpp/core/dtype.cpp
Comment thread packages/react-native-executorch/cpp/extensions/speech/phonemizer.cpp Outdated
Comment thread packages/react-native-executorch/cpp/extensions/speech/phonemizer.cpp Outdated
Comment thread packages/react-native-executorch/src/extensions/speech/utils/kokoroUtils.ts Outdated
Comment thread packages/react-native-executorch/src/extensions/speech/utils/kokoroUtils.ts Outdated
Comment thread packages/react-native-executorch/src/extensions/speech/utils/kokoroUtils.ts Outdated
@msluszniak

Copy link
Copy Markdown
Member

Example app looks solid, everything worked correctly. I will do a second pass on this one and I will be good with this PR :))

@barhanc barhanc left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Second pass. Tested example app and it works great. After the pending comments are resolved, I think we can merge this.

Comment thread packages/react-native-executorch/src/extensions/math.ts Outdated
Comment thread packages/react-native-executorch/src/extensions/math.ts Outdated
Comment thread packages/react-native-executorch/src/extensions/speech/utils/phonemizer.ts Outdated
Comment thread packages/react-native-executorch/src/hooks/useTextToSpeech.ts Outdated
Comment thread packages/react-native-executorch/src/hooks/useTextToSpeech.ts Outdated
Comment thread packages/react-native-executorch/src/hooks/useTextToSpeech.ts
@IgorSwat
IgorSwat force-pushed the @is/rne-rewrite-kokoro branch from c3e5bc9 to a31a007 Compare August 19, 2026 15:19
@msluszniak
msluszniak merged commit e85ff28 into rne-rewrite Aug 19, 2026
3 checks passed
@msluszniak
msluszniak deleted the @is/rne-rewrite-kokoro branch August 19, 2026 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature PRs that implement a new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[RNE Rewrite] Speech - add Kokoro/Supertonic TTS pipeline implementation

3 participants