phyce / rl-natural-speech

Text to speech with high quality voices plugin for runelite
BSD 2-Clause "Simplified" License
9 stars 2 forks source link

crashing on special characters #15

Open SirFireNewt opened 1 month ago

SirFireNewt commented 1 month ago

I can't help but feel like I'm partly to blame for this lol In game my fremennik name is barrak dräpare, when I talk to an npc like falo the bard who calls the player by their fremennik name it consistently crashes

snipit from client.log if there's another log or more info I should send your way lmk

2024-05-21 00:00:32 EDT [Client] WARN  d.p.naturalspeech.tts.TextToSpeech - Starting piper for libritts when there are already pipers running for the model.
2024-05-21 00:00:32 EDT [[Piper for libritts with 1 active processes] Piper::processPiperTask Thread] ERROR d.p.naturalspeech.tts.piper.Piper - pid:dead model:libritts.onnx had an unexpected exited, either crashed or terminated by user.
2024-05-21 00:00:32 EDT [[Piper for libritts with 1 active processes] Piper::processPiperTask Thread] ERROR net.runelite.client.RuneLite - Uncaught exception:
java.util.ConcurrentModificationException: null
    at java.base/java.util.HashMap$HashIterator.remove(Unknown Source)
    at dev.phyce.naturalspeech.tts.piper.Piper.processPiperTask(Piper.java:130)
    at java.base/java.lang.Thread.run(Unknown Source)
2024-05-21 00:00:32 EDT [Client] INFO  d.p.n.tts.piper.PiperProcess - D:\appdata\piper\piper.exe --model D:\appdata\piper\models\libritts\libritts.onnx --output-raw --json-input
phyce commented 1 month ago

I have just checked and can confirm that you are not partly to blame for this hahaha (if you're referring to issue #12) It seems like piper just crashes when it receives the "ä" character. I am not sure if this is an issue with the piper engine itself, or just with that model, I assume English was not trained to understand other characters not included in the english alphabet.

Seems like we need to keep track the accepted character list for each one of the engines/models, and possibly have some replacement characters.

Good find, thanks for reporting.

SirFireNewt commented 1 month ago

Good to hear I'm not partly at fault lol

And happy to help, I love the plugin!

TheLouisHong commented 1 month ago

Hi @SirFireNewt !

  1. We found a fix and will do a hotfix to the plugin with version 1.2.5.

  2. It's possible to manually fix the current 1.2.4 Natural Speech by adding a RuneLite configuration.

By adding -Dfile.encoding=UTF8 on a new line inside JVM arguments, we can configure RuneLite to correctly handle the text from the new game update.

chrome_2024-05-26_15-29-19

https://github.com/runelite/runelite/wiki/RuneLite-Launcher-Configuration