Repository navigation
Add JavaScript API (node-addon) for KittenTTS - #2470
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds JavaScript API support for KittenTTS, a text-to-speech model. It introduces configuration and implementation for the Kitten TTS model across the Node.js addon and Harmony OS platforms.
- Adds Node.js example demonstrating KittenTTS usage with configuration and audio generation
- Implements KittenTTS model configuration support in both Node.js addon and Harmony OS
- Updates CI workflow to test the new KittenTTS functionality
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| nodejs-addon-examples/test_tts_non_streaming_kitten_en.js | New example demonstrating KittenTTS usage with audio generation |
| nodejs-addon-examples/README.md | Adds documentation for the new KittenTTS example |
| harmony-os/SherpaOnnxHar/sherpa_onnx/src/main/ets/components/NonStreamingTts.ets | Adds KittenTTS model configuration class |
| harmony-os/SherpaOnnxHar/sherpa_onnx/src/main/cpp/non-streaming-tts.cc | Implements C++ configuration parsing for KittenTTS |
| harmony-os/SherpaOnnxHar/sherpa_onnx/Index.ets | Exports the new KittenTTS configuration class |
| .github/workflows/test-nodejs-addon-api.yaml | Updates CI configuration for testing |
| .github/scripts/test-nodejs-addon-npm.sh | Adds KittenTTS testing to CI script |
Comments suppressed due to low confidence (1)
| @@ -37,9 +37,9 @@ jobs: | |||
| strategy: | |||
| fail-fast: false | |||
There was a problem hiding this comment.
The matrix was changed to remove a duplicate 'ubuntu-latest' entry, but this appears to reduce test coverage. Consider adding a comment explaining why this OS configuration was changed or verify this is intentional.
| fail-fast: false | |
| fail-fast: false | |
| # The matrix previously included a duplicate 'ubuntu-latest' entry. | |
| # It was removed to avoid redundancy and does not reduce test coverage, | |
| # as all required configurations are still tested. |
| matrix: | ||
| os: [macos-latest, ubuntu-latest, ubuntu-latest] | ||
| os: [macos-latest, ubuntu-latest] | ||
| node-version: ["16", "22"] |
There was a problem hiding this comment.
The Python version was updated from '3.8' to '3.10'. Consider adding a comment or documentation explaining the reason for this version requirement change.
| node-version: ["16", "22"] | |
| node-version: ["16", "22"] | |
| # Updated Python version from 3.8 to 3.10 to support dependencies and features required by the project. |
|
Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. Caution Review failedThe pull request is closed. WalkthroughSupport for the "kitten" offline text-to-speech (TTS) model was added across multiple layers: C++ backend, Harmony OS ETS classes, Node.js test scripts, and documentation. The Node.js addon test workflow was updated to include the new model, and the GitHub Actions workflow matrix was simplified and updated for Python version. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant NodeScript as Node.js Test Script
participant TTSAddon as Node.js Addon (C++)
participant ModelFiles
participant OutputWav
User->>NodeScript: Run test_tts_non_streaming_kitten_en.js
NodeScript->>ModelFiles: Load Kitten model files
NodeScript->>TTSAddon: Create OfflineTts instance with Kitten config
NodeScript->>TTSAddon: Synthesize speech from text
TTSAddon-->>NodeScript: Return waveform data
NodeScript->>OutputWav: Write waveform to WAV file
NodeScript->>User: Log timings and output filename
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~15 minutes Possibly related PRs
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (7)
✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Summary by CodeRabbit