karashiiro / TextToTalk

Chat TTS plugin for Dalamud. Has support for triggers/exclusions, several TTS providers, and more!
MIT License
46 stars 30 forks source link

Bug: Limit player TTS frequency disables all TTS #113

Open allibear17 opened 2 years ago

allibear17 commented 2 years ago

Tested with party and with linkshell. With the option toggled on it behaves as if I've toggled all TTS to disabled. I maxed out the limit and still nothing.

karashiiro commented 2 years ago

Possibly fixed with v1.15.3

allibear17 commented 2 years ago

This is still occurring unfortunately. If there Is any thing I could try settings wise or logs wise to help narrow it down, please let me know.

ryankhart commented 2 years ago

I took a look at this just now. I had not been using that feature, myself because I didn't see a use for it, but now that I've been seeing of my FC members using multi-line ascii art chat macros, I can see how this feature would be useful. I can take a wack at it.

I have this lead to go on from this System.NullReferenceException error when I try to chat with that feature enabled.

04:06:22.314 | ERR Could not invoke registered OnMessageDelegate for "OnChatMessage"
System.NullReferenceException: Object reference not set to an instance of an object.
   at TextToTalk.TextToTalk.ShouldRateLimit(GameObject speaker) in K:\arashiiro\TextToTalk.cs:line 184
   at TextToTalk.TextToTalk.Say(GameObject speaker, String textValue, TextSource source) in K:\arashiiro\TextToTalk.cs:line 158
   at TextToTalk.Middleware.ChatMessageHandler.ProcessMessage(XivChatType type, UInt32 id, SeString& sender, SeString& message, Boolean& handled) in K:\arashiiro\Middleware\ChatMessageHandler.cs:line 82
   at Dalamud.Game.Gui.ChatGui.HandlePrintMessageDetour(IntPtr manager, XivChatType chattype, IntPtr pSenderName, IntPtr pMessage, UInt32 senderid, IntPtr parameter) in C:\goatsoft\companysecrets\dalamud\Game\Gui\ChatGui.cs:line 354
ryankhart commented 2 years ago

@allibear17 Oh, I think I just found the problem, but first let me confirm with you what you are doing exactly to test this.

Are you using /echo chats to test it? If so, I believe the reason why it doesn't work is because /echo chats do not have a speaker, and right now, the plugin source code assumes that a speaker exists, and if it doesn't, it gives and error exception like the one above.

There are 2 options we could potentially take with this.

  1. If the speaker is null, ignore the TTS frequency limit and just speak it anyway.
  2. If the speaker is null, consider all TTS attempts with a null speaker to be from the same speaker. My opinion of this is that this option could cause more problems than it solves because you might get multiple chats with a null speaker that you might actually want to hear.

Do you have a specific use case for wanting to limit TTS for chats with no speaker?

ryankhart commented 2 years ago

I can confirm that my test build with option 1 implemented has solved the issue for me, but I'll wait until I hear your feedback before I make a pull request to Karashiiro.

allibear17 commented 2 years ago

I'm simply turning the option on and off when I am in a party. I have it set to read party AND linkshell1 aloud. The moment I turn it on it stops entirely with either channel.

I have an exclusion for myself so it doesn't read my stuff aloud. I'll try later today to test it with the exception off and tweaking some settings to see if I can find something else connected.

ryankhart commented 2 years ago

Ok, so it sounds like we were each having different causes for why TTS stopped working then.

Could you post a log snippet here either from your %appdata%\XIVLauncher\dalamud.log or from copy/pasting from /xllog in-game when you have "Limit player TTS frequency" enabled and you expected TTS but it didn't play? In particular, what I'm looking for is a line that says "ERR" short of error.

I've been playing for the past couple hours with it enabled, and I haven't had any issues yet.

Also, could you post your TextToTalk.json config file from the %appdata%\XIVLauncher\pluginConfigs folder? I want to try to reproduce the issue with your config file.

allibear17 commented 2 years ago

dalamud.log TextToTalk - Copy.txt

I had to change the .json file to a .txt file since github wouldn't let me upload it for some reason. Should still show everything correctly.

ryankhart commented 2 years ago

@allibear17 Thanks for that. I'm planning on testing some specifics today, but I'm still working on it.

But while I was looking through your configs, I noticed that you had several lexicons installed, but none of them were enabled for "System" your current voice backend. So, they've actually not been doing anything since you've installed them. I have a friend I got into this plugin and the same thing happened with him. I'm petitioning that we change those to enabled by default in this issue #119.

karashiiro commented 2 years ago

I've been working on one of my finals or I'd look into this personally, thanks for looking into this in the meantime 🙏