### Applies to
- All game clients (tested with Retail, TBC, Era, SoM)
- All OS… plattforms (tested on PC, Mac)
### Description of the issue
Calling [C_VoiceChat.SpeakText](https://www.townlong-yak.com/framexml/live/Blizzard_APIDocumentation#C_VoiceChat.SpeakText) leads to a freeze of the whole game client for 50-100 microseconds, per call.
### Prove
- Login to any game client on any plattform.
- Do something to have some constant noticable action on the screen (eg. auto running).
- Use the following script:
`/script C_VoiceChat.SpeakText(0, "Just a test", 6, 1, 100)`
You will notice a very short freeze of the client (the character won't move, etc.)
The following script calls C_VoiceChat.SpeakText every 0.1s and exposes the issue even more clearly:
`/script C_Timer.NewTicker(0.1, function() C_VoiceChat.SpeakText(0, "Just", 6, 1, 100) end)`
### Severity
Annoying for everyone, game breaking for visually impaired users with accessability addons.
Every addon that is using the ingame TTS via C_VoiceChat.SpeakText is affected. Even the Blizzard accessiblity features like TTS for the chat. Enable the chat TTS, join a busy channel, and you will recognize those constant short freezes on every single new chat line.
That's not that annoying for the Blizzard accessablility feature, or for addons like boss mods, as they don't constantly using C_VoiceChat.SpeakText.
#### Additional details on severity for accessability
Accessabililty addons are using C_VoiceChat.SpeakText a lot more. Example: My addon features lists, where the user can move through the list using the arrow keys. On each move the current entry is utteranced. The users of course move to other list entries very fast (they are used to it). No just once per second, but many times a second. There would be many calls of C_VoiceChat.SpeakText per second, and that leads to a really inacceptable amount of freezes, as the freeze is on every call.
Due to that the TTS via C_VoiceChat.SpeakText is not usable for real world accessability scenarios at the moment. Many of such scenarios do require to utterance a lot of text that changes in high speed (visually impaired users are very fast on using / getting audio content 😊). The required extensive use of C_VoiceChat.SpeakText leads to heavy client freezes, making the game unplayable for them.
Here are two videos, showing the real world issues. The are about one of my accessability addons. It provides an audio menu, listing a lot of waypoints, where the user could select on of those waypoints. It's in German, but as it just is about the concept that shouldn't matter.
In the first video I am using my own custom build TTS engine (that is using [PlaySoundFile](https://wowpedia.fandom.com/wiki/API_PlaySoundFile)). That's how it should be:
[https://1drv.ms/v/s!Aqgp3J_s6MM7iKNqwACraFGdVzlZOQ?e=V2xI7a](https://1drv.ms/v/s!Aqgp3J_s6MM7iKNqwACraFGdVzlZOQ?e=V2xI7a)
In the second video I've replace my custom TTS by the ingame TTS, using VoiceChat.SpeakText:
[https://1drv.ms/v/s!Aqgp3J_s6MM7iKNrCFd35oX2PJb6pg?e=T4rVDa](https://1drv.ms/v/s!Aqgp3J_s6MM7iKNrCFd35oX2PJb6pg?e=T4rVDa)
That lag / freeze is from VoiceChat.SpeakText. :/
### Addtional findings
- Calling C_VoiceChat.SpeakText with different arguments for voiceID, text, destination, rate, and volume changes nothing on that freeze. Apparently it's there with every possible combination of arguments.
- The duration of the freeze seems to be independent from the text that was passed to VoiceChat.SpeakText.
The following example leads to the mentioned short freeze:
`/script C_VoiceChat.SpeakText(0, "Just a test", 6, 1, 100)`
The following example leads to the same freeze:
`/script C_VoiceChat.SpeakText(0, "Just a test Just a test Just a test Just a test Just a test Just a test Just a test Just a test Just a test Just a test Just a test Just a test Just a test ", 6, 1, 100)`
- However, if VoiceChat.SpeakText is called multiple times in a single update circle, the freezes are incremental. Calling it 5 times in a row leads to a noticable longer freeze (like 200 ms instead of 50 ms):
`/script C_VoiceChat.SpeakText(0, "Just", 6, 1, 100) C_VoiceChat.SpeakText(0, "Just", 6, 1, 100) C_VoiceChat.SpeakText(0, "Just", 6, 1, 100) C_VoiceChat.SpeakText(0, "Just", 6, 1, 100) C_VoiceChat.SpeakText(0, "Just", 6, 1, 100)
`