cactbot icon indicating copy to clipboard operation
cactbot copied to clipboard

Feature Request(Raidboss): allow post-process for *-text and TTS

Open MaikoTan opened this issue 4 years ago • 2 comments

Summary

This is a feature request from the Chinese community.

To expose an interface that let user can modify the text on the fly. My thought is to add a field that acts as middleware in Options:

Options.PostProcessText = function(text: string, type: 'info' | 'alert' | 'alarm' | 'tts', next: Function): string {
  // do something to `text` and return `next(text, type)`.
  // or directly return `text` if don't want to perform cactbot's built-in post-process rule.
  // maybe also support `this.data`/`this.matches` etc so that it knows the context of current call out?
}

Also, extract cactbot's built-in post-process function and allow users to override it, like the one for TTS here: https://github.com/quisquous/cactbot/blob/6cb3596707531ff0647e6d78d448e0cfbcc90a1d/ui/raidboss/popup-text.ts#L1247-L1273

Reason

Part of the reason is that the Chinese call-outs are too complicated to be TTS-ized, especially there are many polyphonic characters in Chinese and some TTS engines didn't read the correct pronunciation. (There are some polyphonic characters in Japanese that cause problems, too, but significantly fewer than Chinese.)

With a post-processor, we can do:

  • replace polyphonic characters programmatically
  • prefix/postfix some words that they like, to improving TTS, etc.
  • replace some common words like "East/South/West/North" (some players prefer "Up/Down/Left/Right" even though that confuse with "Move Left/Right of the Boss") without touch a bunch of settings of triggers
  • ....

MaikoTan avatar Sep 03 '21 09:09 MaikoTan

I think my general feeling is that people can use the config ui to change text alerts on screen, e.g. east/south/west/north. (Similarly, if your group has markers down, you could change these to say A/B/C/D.) For TTS, there is Options.TransformTts, which is like what you suggested above, but only for TTS. Does the combination of those solve what you're looking for?

quisquous avatar Sep 06 '21 20:09 quisquous

Following up here again, does Options.TransformTts and the config ui solve these problems?

quisquous avatar Apr 09 '22 19:04 quisquous

Yes, sorry for not taking a look for a long time. And it looks like most users chose to change these text via the config UI that you mentioned, so I think this feature is not important now. I'll close this unless there is someone who really wants this.

MaikoTan avatar Jan 31 '23 06:01 MaikoTan