-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat:lang2voice #3
Conversation
WalkthroughThe changes introduce an additional parameter, Changes
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Outside diff range and nitpick comments (1)
ovos_tts_plugin_edge_tts/__init__.py (1)
181-193
: LGTM! Consider adding error handling for unsupported languages.The changes to the
stream_tts
method look good. The newlang
parameter adds flexibility by allowing language-based voice selection when no specific voice is provided. The implementation correctly standardizes the language tag and selects the first available voice for that language.Consider adding error handling for cases where the provided
lang
is not in theVOICES
dictionary. This would improve the robustness of the method. For example:if lang and not voice: lang = standardize_lang_tag(lang, macro=True) if lang in VOICES: voice = VOICES[lang][0] else: raise ValueError(f"Unsupported language: {lang}")
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
- ovos_tts_plugin_edge_tts/init.py (1 hunks)
🔇 Additional comments (1)
ovos_tts_plugin_edge_tts/__init__.py (1)
Line range hint
1-199
: Overall, the changes look good with room for minor improvements.The modifications to the
EdgeTTSPlugin
class, particularly thestream_tts
method, enhance its functionality by adding language-based voice selection. The new main block provides a basic usage example. The suggested improvements, if implemented, would further increase the robustness and demonstrative value of the code.🧰 Tools
🪛 Ruff
179-179: Ambiguous variable name:
l
(E741)
179-179: Use
key in dict
instead ofkey in dict.keys()
Remove
.keys()
(SIM118)
Summary by CodeRabbit
New Features
Bug Fixes