Skip to content

fix(kokoro): register streamStop on JSI host object#951

Merged
msluszniak merged 1 commit intosoftware-mansion:mainfrom
yocontra:fix/kokoro-stream-stop
Mar 10, 2026
Merged

fix(kokoro): register streamStop on JSI host object#951
msluszniak merged 1 commit intosoftware-mansion:mainfrom
yocontra:fix/kokoro-stream-stop

Conversation

@yocontra
Copy link
Contributor

Summary

Kokoro::streamStop() exists in C++ (Kokoro.cpp:205) and is called from the JS TextToSpeechModule.streamStop() via this.nativeModule.streamStop(), but it's never registered on the JSI host object in ModelHostObject.h.

This causes a runtime error when stopping TTS streaming:

TypeError: this.nativeModule.streamStop is not a function (it is undefined)

The fix registers streamStop as a synchronousHostFunction in the Kokoro if constexpr block, matching the existing pattern used for SpeechToText.

Changes

  • ModelHostObject.h: Add streamStop JSI registration for Kokoro model type

Kokoro::streamStop() exists in C++ but was never exposed via JSI in
ModelHostObject. This causes a runtime TypeError when
TextToSpeechModule.streamStop() tries to call this.nativeModule.streamStop(),
which is undefined.

Register it as a synchronousHostFunction, matching the pattern used for
SpeechToText's streamStop.
@msluszniak msluszniak added the bug fix PRs that are fixing bugs label Mar 10, 2026
@msluszniak
Copy link
Member

Good catch, thank you. :))

@msluszniak msluszniak merged commit e0742e3 into software-mansion:main Mar 10, 2026
4 checks passed
@yocontra yocontra deleted the fix/kokoro-stream-stop branch March 10, 2026 18:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug fix PRs that are fixing bugs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants