Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
TTS: Fix crashing and freezing when compiled with msvc #1831
This pull request resolves crashing when compiling with msvc and using text to speech. The crashes were actualy caused by Common::Encoding, that returned a converted string from SDL_iconv_string(), which couldn't be freed by free(), while strings returned by Common::Encoding should be freed by free().
This also fixes the freezing caused by waiting on a thread while trying to stop speech (the freeze could last up to multiple seconds). There still is a barely noticable lag when using TTS in the GUI and moving fast with the cursor between multiple GUI widgets and thus starting and stoping multiple speeches too quickly. This is caused by a call to ISpVoice->Speak() inside the stop() method. I haven't found a better solution to stopping the speech yet, but the lag shouldn't be noticable with TTS in games (like in Mortevielle) and people with reduced sight (which should be the people, that will be using the TTS in GUI) also shouldn't notice.
criezy left a comment
Nice. I had started to look at this as well and I came up with the same solution you did to compute the size in byte of a string.
However I don't agree with the commit aa5ab6f. We cannot do the copy everywhere where
Also please add a