Updated default TTS Multi Voice .js file#284
Updated default TTS Multi Voice .js file#284samsonsin wants to merge 2 commits intojing332:composefrom
Conversation
and supports 3 deep nesting as well as multiple brackets in a row.
There was a problem hiding this comment.
The bracket batching regex is longer and more convoluted because it matches up to 3 sub bracket groups at the top level, and up to 3 deep in each. It can be extended to match more widely as a regex if needed, but what's already there is likely more than enough. As a matter of fact, if deemed necessary, trimming it down to the most simple form, quite like the curly bracket regex, may be warranted.
Sadly, recursion is not easily handled using regex. If recursive rules such as this is desired, then a more programmatic approach may be more prudent. An extendable framework could be nice, or perhaps some control bits that enable recursive behavior in the regex matching loop could also be possible. For now though, I believe these are extreme edge cases, so this is likely to be massive overkill.
|
Hi @samsonsin is this for the bad handshake fix? |
No, it's simply an updated version of the default mutli voice rule file. The original version programatically separated narration from dialogue, and extending functionality using that file would require more extensive work, especially for advanced matches. Hence, this update instead allows you to configure a cascading set of regex - tag pairs. Provided you know basic regex, you can match complex patterns as different voices using it, as well as have cascading rulesets. It could potentially be augmented with a Gui interface and a regex generator for the simplest types of matches, but I'm unsure if such is warranted. |
|
Thank you for your explanation and fast reply you're a G. |
|
HaHa 😆 |
Hello!
I have been using the app for a while, and wanted more flexibility with my multi voice rules. As such, i choose to rewrite the default speech rules to support some more advanced features like regex matching. This allows for some complex behaviours that would take time to implement programatically, and are problems of the type that are quite prone to bugs.
I have never contributed to a project such as this, so please let me know if you'd like me to modify or otherwise extend this code.
Some possible improvments i can think of right now would be using a more extensive Regex engine which supports some useful functions like variable lookbehinds or the \K control character. I am unsure as to how exactly one would do this on an android app, but please let me know if there are some resources i can make use of to make this improvement.
Another improvement would be the addition of some sort of UI element that could allow a user to add and remove regex rules without entering the code editor. Again, same problem for me as with above.
Either way, thank you for the amazing app!