-
Notifications
You must be signed in to change notification settings - Fork 24
Add option to replace underscores in author names for TTS #1363
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
base: main
Are you sure you want to change the base?
Conversation
Introduces a new setting to replace underscores with spaces in author names when generating TTS prelude. Adds a toggle in the TTS settings screen and persists the setting in the TtsModel.
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.
Pull request overview
This pull request adds a user-configurable option to replace underscores with spaces in author names when they are spoken by the Text-to-Speech system, improving pronunciation of usernames containing underscores.
Changes:
- Added a new boolean property
_isUnderscoreReplacementEnabledto theTtsModelwith getter/setter methods - Implemented underscore replacement logic in the
getVocalizationmethod for TwitchMessageModel author names - Added persistence support through JSON serialization/deserialization
- Added a UI toggle switch in the TTS settings screen to control this feature
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| lib/models/tts.dart | Added the _isUnderscoreReplacementEnabled property, implemented the underscore replacement logic for author names, and included the property in JSON serialization/deserialization |
| lib/screens/settings/tts.dart | Added a new SwitchListTile to allow users to toggle the underscore replacement feature |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| var author = model.author.displayName ?? model.author.login; | ||
| if (_isUnderscoreReplacementEnabled) { | ||
| author = author | ||
| .replaceAll("_", " ") | ||
| .replaceAll(RegExp(r'\s+'), ' ') | ||
| .trim(); | ||
| } |
Copilot
AI
Jan 20, 2026
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.
The underscore replacement is only applied to author names in TwitchMessageModel, but not to other event types that also use display names, such as TwitchRaidEventModel (line 169) and TwitchFollowEventModel (line 184). This creates an inconsistent user experience where some spoken names will have underscores replaced and others won't. Consider applying the same transformation to all user display names for consistency.
kevmo314
left a comment
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.
This seems reasonable but we should always replace underscores if it sounds better, it doesn't need to be a setting.
Maybe set it as true as default ? I don't know if there is many users that compained about this; |
This pull request adds a new feature to the Text-to-Speech (TTS) system that allows users to replace underscores in author names with spaces, improving the readability of spoken names. The change includes UI, model, and persistence updates to support this new option.
New feature: Underscore replacement in author names
_isUnderscoreReplacementEnabledproperty toTtsModel, with associated getter and setter, and included it in model serialization/deserialization to persist the setting. [1] [2] [3] [4]TtsModelto replace underscores with spaces in author names when the new setting is enabled.User interface updates
TextToSpeechScreen) to allow users to toggle the underscore replacement feature.