Repository navigation
Build APKs for MatchaTTS Chinese+English - #2882
Conversation
Summary of ChangesHello @csukuangfj, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request integrates the Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request adds support for building APKs for the MatchaTTS Chinese+English model. The changes include updates to the build scripts, example configurations in the Android apps, and significant refactoring of coroutine and channel handling in the SherpaOnnxTtsEngine's MainActivity. The coroutine management improvements are good, but I've identified a couple of issues with the channel communication logic that could lead to hangs or data loss. I've provided specific suggestions to address these. Additionally, I've suggested a small refactoring in the shell scripts to improve maintainability.
| val ok = samplesChannel.trySend(samplesCopy).isSuccess | ||
| Log.i(TAG, "callback called with $ok") |
There was a problem hiding this comment.
While logging the success status of trySend is useful for debugging, the log message could be more informative, especially for the failure case. When trySend fails, audio samples are dropped, which can lead to degraded audio quality. It would be better to log this as a warning to highlight the data loss.
Consider checking the return value and logging a warning if the send operation was not successful.
val ok = samplesChannel.trySend(samplesCopy).isSuccess
if (!ok) {
Log.w(TAG, "Channel buffer is full. Dropping audio samples.")
}| if [[ $model_dir == matcha-icefall-zh-en ]]; then | ||
| lang=zh_en | ||
| fi |
There was a problem hiding this comment.
This adds another if block to set lang=zh_en. To improve readability and maintainability, consider grouping all conditions that set lang to zh_en into a single control structure, like a case statement. This would make the script easier to read and modify in the future.
For example:
case $model_dir in
vits-melo-tts-zh_en|\
matcha-icefall-zh-en|\
kokoro-multi-lang-v1_0|\
kokoro-multi-lang-v1_1|\
kokoro-int8-multi-lang-v1_1)
lang=zh_en
;;
esac| if [[ $model_dir == matcha-icefall-zh-en ]]; then | ||
| lang=zh_en | ||
| fi |
There was a problem hiding this comment.
This adds another if block to set lang=zh_en. To improve readability and maintainability, consider grouping all conditions that set lang to zh_en into a single control structure, like a case statement. This would make the script easier to read and modify in the future.
For example:
case $model_dir in
vits-melo-tts-zh_en|\
matcha-icefall-zh-en|\
kokoro-multi-lang-v1_0|\
kokoro-multi-lang-v1_1|\
kokoro-int8-multi-lang-v1_1)
lang=zh_en
;;
esacCo-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
|
Caution Review failedThe pull request is closed. 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. WalkthroughThis PR adds support for the Matcha-icefall Chinese-English (zh-en) TTS model by introducing configuration examples in Android apps, build script conditionals for language assignment, a new model group definition in the Python build generator, and an updated gitignore pattern. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Possibly related PRs
Suggested labels
Poem
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (7)
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. Comment |
Summary by CodeRabbit
New Features
Documentation
Chores
✏️ Tip: You can customize this high-level summary in your review settings.