Jocys.com Text to Speech Monitor and WoW Addon

Source (GitHub.com) Issues (GitHub.com) Forum Help Code Help DOWNLOAD Monitor 3.2.7 (2019-10-22) and WoW Addon 8.2.5.10 (2019-11-05)

WoW Addon and TTS Monitor reads quests and chat messages with text-to-speech voices. Program will choose correct gender and apply special audio effects depending on character type. It makes game more immersive and you will not miss messages in chat. Addon’s text-to-speech feature allows visually impaired people to enjoy the game too. Supports locally installed and Amazon Polly (Cloud) Standard and Neural voices. Works with WoW version 8.x and official WoW Classic. E-mail: info@jocys.com

How it works


  1. “WoW Addon” creates XML message <message><part>text</part></message> when you open window with text (dialogue, quest, book, etc.) or receive chat message in game. This message can include text, name, gender, effect, group, pitch, rate, volume, etc. and command values.
  2. “WoW Addon” converts XML text message to line of coloured pixels and shows this line inside your in-game window. 1 RGB pixel can hold 3 bytes or 3 ASCII characters or 1 UTF8 Japanese character.
  3. “TTS Monitor” (must be running in the background) captures this line of coloured pixels and converts it back to the text message > then converts it to SAPI XML > then reads it with specific text-to-speech voice, if “Monitor: Display” capturing mode is enabled.

Note: Make sure you do not cover coloured pixel line with other game elements. “TTS Monitor” supports other message capturing methods and “Cache” option which allows to use manually pre-recorded voices.

How to move mini frame with [≡] (Options) and [■] (Stop) buttons

Move mouse pointer over [■] button. [≡] button will appear. Click on [≡] button, to open “Options” window. Unlock frame by unchecking check-box in “Options” window (“Lock frame with [Options] and [Stop] buttons.”). Move “Options” window out of the way, if it is on top of frame with [≡][■] buttons. Move frame by clicking on black background around [≡][■] buttons. Lock it again, by checking the same check-box.

Your own addons and games with text-to-speech feature

You can create your own text-to-speech addons for games (if they supports addons) or send text-to-speech <messages> directly to “Monitor” from your own game. “WoW Addon” <messages> (examples) can be visible in WoW game chat and “Options” window. Enter /JocysComTTS Debug to enable or disable detailed information in chat window. <Messages> are also visible in “Monitor’s” [1. Incoming Messages] tab. You can find help and examples in “WoW Addon’s” *.LUA file and Code Help section.

Security and concerns • Why it is not on Curse?

It is not on Curse because of “Monitor”, which is external program. Blizzard has no control outside the game over “Monitor” and, reasonably, can’t take responsibility for it, by allowing it on Curse. Therefore, we keep everything as transparent, as possible. This project is open source and anyone can check all code at any time. We digitally sign our software and put our real names on it, so everyone could know, who to blame, if something will go wrong. “Monitor” and “WoW Addon” does not give you more power over NPCs or other players in game. It does not send data back to game or anywhere else. It only reads (depends on enabled mode) coloured pixel line, local network messages or text from your clipboard between <message> tags with installed text-to-speech voices, when you want it. It makes game more involving, fun and interesting (especially for those people, who played WoW from the first day, when it was released… like us. It became slightly boring to read all quests after some time). Also, it makes game easier for people with dyslexia or visual impairments. We are grateful, that gods from Pantheon of Blizzard are merciful enough not to block “WoW Addon” and let people use it :). Please download this “WoW Addon” and “Monitor” only from trustworthy sources. Make sure that “Monitor” is always signed by verified publisher with signature, issued by trusted certificate authority.

Text-to-Speech Voices

FREE: MICROSOFT Language Packs
BETTER: IVONA Harpo Software
THE BEST: Amazon Standard and Neural

“WoW Addon” ( old 2014-08-06 version ) with Ivona voices.

Old Versions

To show WoW version, paste in chat: /run print((select(4, GetBuildInfo())));

2019-06-26 (80200 / 8.2.0)
2018-09-24 (80000 / 8.0.1)
2017-11-30 (70300 / 7.3.2)
2017-09-27 (70300 / 7.3.0)
2017-04-03 (70200 / 7.2.0)
2016-11-01 (70100 / 7.1.0)
2017-12-02 (70300 / 7.3.2)
2016-07-24 (70000 / 7.0.3)
2014-10-16 (60000 / 6.0.5)
2014-08-27 (50400 / #.#.#)

Few earliest files, we still have, are from 2012-03 (40200). “WoW Addon” required mouse with programmable button, worked with “Ivona Reader” and was far from perfect to make it public. Only versions after 2014-08 (50400) survived, when we had simple idea how to send, get and read WoW messages from local network and created “TTS Monitor”.

“MONITOR” VERSION UPDATES AND FIXES

3.2.7 (2019-10-18) -- Support for Amazon Polly Text-To-Speech Standard and Neural voices added.
3.1.4 (2019-10-06) -- "Display" mode added. New message sending and capturing technique (color pixels of the display).
2.6.16 (2018-11-10) -- "Voice" column added and "ON" column works now in [Voice Defaults] tab. [Update] tab fixed.
2.6.13 (2018-07-29) -- Updated custom audio file recording and reading settings. Added MP3 support.
2.6.7 (2018-07-27) -- Updated Audio Player. Fixed playback on non-default playback devices.
2.5.9 (2018-05-15) -- Fixed XAudio2 problem on Windows 8+.
2.5.7 (2018-05-14) -- Intro sounds crashing "Monitor" problem fixed.
2.5.6 (2018-05-12) -- [Options] tab > "Output Device:" drop-down added. Now you can select output device for audio.
2.4.22 (2018-01-22) -- Search now includes "Group" column in [Acronyms] tab.
2.4.21 (2018-01-22) -- [Select All], [Deselect All], [Check Selected], [Uncheck Selected] buttons added in [Acronyms] tab.
2.4.20 (2017-12-01) -- "Cache TTS audio" option added in [Options] tab to save CPU resources.
2.4.18 (2016-12-20) -- Acronym "be" > "blood elf" disabled by default.
2.4.18 (2016-12-14) -- Fixed: "Radio" sound, [Acronyms] "ON" checkbox, "Sequence" and "Size" values.
2.4.8 (2016-12-14) -- Tab for acronym replacements, like "brb" > "be right back", added.
2.4.7 (2016-11-15) -- WinPcap option disabled if not installed. Other WinPcap related updates.
2.4.6 (2016-11-15) -- TCP/IPv6 support added. Voice "overrides" updated to "defaults".

“ADDON” VERSION UPDATES AND FIXES

2.5.5.10 (2019-11-05) -- Added "Channel" chat messages. Added quest and chat language (locale) check-boxes.
2.5.5.8 (2019-10-18) -- Added "InCombatLockdown()" check for "EditMacro()". Fixes, improvements.
2.5.5.7 (2019-10-14) -- Bug with "QuestMapFrame" in "WoW Classic" fixed. [■][►] Buttons aligned to frames.
2.5.5.6 (2019-10-12) -- "Mail" play on window open. "Include Quest Title" check-box added. Fixes, improvements.
2.5.5.3 (2019-10-09) -- [■][►] buttons and mouse wheel scroll frame added to Mail Text window.
2.5.5.2 (2019-10-06) -- "Display" mode added. New message sending and capturing technique (color pixels of the display).
2.3.3 (2018-09-24) -- Fixed (401) MSG_RAID > CHAT_MSG_RAID, (422) MSG_INSTANCE > CHAT_MSG_INSTANCE_CHAT.
2.3.2 (2018-07-29) -- "Addon" sends character’s Name, custom-tts Name and Class for added Cache Options in "Monitor".
2.3.1 (2018-07-27) -- Check-boxes added: "PartyLeader", "GuildLeader"(Officers). "Battleground" removed.
2.3.0 (2018-05-11) -- Version updated for WOW 8.0.1 ("Battle for Azeroth").
2.2.96 (2017-12-02) -- Code related to Battle.net chat messages (whispers) updated.
2.2.95 (2017-11-30) -- Version updated for WOW 7.3.2 -- [■] Button works again. Code line 397 updated.
2.2.90 (2017-04-03) -- Version updated for WOW 7.2.0.
2.2.88 (2016-12-18) -- Mini frame [≡][■] assigned to "UIParent" frame - visible with addons like "elvui".
2.2.88 (2016-12-18) -- After update, mini frame [≡][■] can appear at the center of the screen.
2.2.88 (2016-12-18) -- Click on [≡] button to open "Options". Unlock this mini frame [≡][■] and move.
2.2.86 (2016-12-14) -- "<OnEnter>JocysCom_SaveButton:Show();</OnEnter>" disabled.
2.2.85 (2016-11-15) -- Replace function updated.
2.2.82 (2016-11-10) -- Replaces text "|#-#(Race/Class)" with "Race/Class" for "Monitor".
2.2.80 (2016-11-04) -- WoW Macro / Saving NPC in "Monitor" related updates.
2.2.78 (2016-11-01) -- TTS macro fixed - ";" symbol removed from macro.
2.2.76 (2016-10-30) -- Menu with checkboxes moved closer to options [≡] button.
2.2.75 (2016-10-30) -- Problem with addon message exeeding 254 character limit fixed.
2.2.72 (2016-10-29) -- Addon sends addon messages instead of whispers + other updates.
2.2.71 (2016-10-27) -- For WOW 7.1 + macro for targeting and saving gender with type added.
2.2.50 (2015-12-01) -- "(Intro)Sound: and "Name(says):" check-boxes for "Quest" group added.

Installation ... exit WoW before installing or updating “Addon”.

1. Download JocysCom-TextToSpeech-WoW.zip file.
2. Open “File Explorer” (Win+E). Locate and open downloaded zip file.
3. Copy JocysCom-TextToSpeech-WoW folder ( folder is inside downloaded zip file ).

4. Paste JocysCom-TextToSpeech-WoW folder inside “Addons” folder of WoW.

Usual directory: #:\Program Files\World of Warcraft\_retail_\Interface\Addons\

5. Install additional text-to-speech voices, if needed.

FREE text-to-speech voices can be installed on Windows:

Windows 10 START > Settings > Time & Language > Language > Add a prefered language... (folow instructions).
Windows 8 language packs. Wikipedia. Not all languages have text-to-speech voices. Switch languages with ( Win+Space ).

• English (United States) - David (male), Zira (female).
• English (United Kingdom) - Heera (female), Hazel (female), Zira (female).
• Chinese Simplified - Hanhan, Huihui.
• Chinese Traditional - Tracy.
• French - Hortense.
• German - Hedda.
• Japanese Haruka.
• Korean - Heami.
• Italian - Elsa.
• Polish - Paulina.
• Portuguese - Maria.
• Russian - Irina.
• Spanish - Helena, Sabina.

CONTENT

BETTER text-to-speech voices are developed by Ivona and distributed (~$45 each) by Harpo Software.

Download and test voices 30 days for free from distributor Harpo Software.
Good Ivona voices are English-British “Amy” and “Brian”. Some other voices are not bad too. If you know free of charge text-to-speech voices as good, as voices by Ivona, please, write us or leave comment about that in comment section.

THE BEST text-to-speech voices are Amazon Polly Neural.

To add Amazon Polly Text-To-Speech Standard and Neural voices to “TTS Monitor” you must have aws.amazon.com account. Help in TTS Monitor > [Options] tab > [Amazon Polly] tab.

AWS “Free Tier” pricing for first 12 months:
Free per month: 5 million characters for Standard voices (~20 0000 WoW quests). Extra Standard chars: $4.00 per 1 million.
Free per month: 1 million characters for Neural voices: (~4 0000 WoW quests). Extra Neural chars: $16.00 per 1 million.

When you will run JocysCom.TextToSpeech.Monitor.exe, additional text-to-speech voices should be visible now.

Run JocysCom.TextToSpeech.Monitor.exe ( file is inside pasted folder ).

Usual directory: #:\Program Files\World of Warcraft\_retail_\Interface\Addons\JocysCom-WoW-TextToSpeech\

You can pin “Monitor” to Windows OS taskbar, if you plan to use it frequently. Make sure that you are using digitally signed software. Digitally signed software ensures that users can verify origin of software and that no one has tampered with it. Any modification in code of software, after it is signed, invalidates digital signature.

“Monitor Clipboard” option doesn’t work and must be [Disabled] in Windows XP.

When “Monitor” will open, setup voices in [ Voices ] tab (example).

3 voices are enabled in this setup:
“IVONA 2 Brian” -- will be used as Male (100) and Neutral (100) voice.
“IVONA 2 Amy” -- will be used as Female (100) voice.
“Microsoft Hazel Desktop” -- will be used as Neutral (50) voice.

Number ( from 0 to 100 ) sets, how often voice should be used, relatively to other voices in the same category (Male, Female or Neutral). If you have IVONA male and female voices, you can disable “Microsoft (...) Desktop” voices ( as they are quite bad ).

Monitor can’t play voices, if their trial period is expired. You can test, which ones are expired, by enabling one voice at a time and pressing [ Speak ] button in Monitor. Such voices must be disabled in [ Voices ] tab.

Speed of voices can be adjusted in “Monitor’s” “Rate” fields. Values can be from “-10” (very slow) to “10” (very fast). Default value is “2”. You can select “1” or “0” in both fields to make voices slower.

Run “World of Warcraft” game.

[■] (Stop text-to-speech) button will appear at the center of the screen. If you will move mouse pointer over[■] button, [≡] (Options) button will appear. If you will move mouse pointer over [≡] button, menu with various check-boxes will appear. Move mouse pointer over any check-box and title will show, what it enables/disables.

[■] (Stop) and [►] (Play) buttons will appear at the bottom of some windows too.

“WoW Addon” macro.

“Addon” can’t get NPC’s gender from chat (if NPC is walking and talking around you). “Addon” can get NPC’s gender only, when NPC is targeted (if you are interacting with NPC) or mouse pointer is over NPC. Therefore, “Addon” automatically sends name, gender and type of NPCs on target/mouseover event to “Monitor“ (“Monitor“ must be running in the background). “Monitor“ saves this information and uses it to generate text-to-speech voices. Saved in “Monitor“ NPCs have genders (male and female voices) in conversations. You can see saved NPCs in “Monitor’s“ [Voice Defaults] tab. If macro slot is available, “Addon“ will create “NPCSaveTTSMacro” and will update it during the game. You can use this macro to target up to 9 last chatting NPCs or any nearest friendly NPC (this will save them automatically in “Monitor“). I didn’t figure out yet, how to get NPC’s gender directly from NPC chat event or some database (there is no problem with getting genders of players from chat). For example: If you see two female NPCs chatting, but they have male voices... just put mouse pointer over them, target (click on) them (or use macro to target them) and they should get female voices from that moment. Enter /m in chat window to show macros:

“Monitor’s” and “Addon’s” settings files and folders.

ADDON: If you will delete these files, default settings will be loaded (WoW game must be closed).

Usual per-account settings directory:
#:\Program Files\World of Warcraft\_retail_\WTF\Account\<AccountName>\SavedVariables\JocysCom-TextToSpeech-WoW.lua

Usual per-character settings directory:
#:\Program Files\World of Warcraft\_retail_\WTF\Account\<AccountName>\<RealmName>\<CharacterName>\JocysCom-TextToSpeech-WoW.lua

MONITOR If you will delete these files (saved program settings, NPCs), default settings will be loaded (“Monitor” must be closed).

Program, [ Voice Defaults ] and [ Intro Sounds ] settings:
C:\ProgramData\Jocys.com\Text to Speech Monitor\Monitor.Settings.xml

[ Effects Presets ] settings:
C:\ProgramData\Jocys.com\Text to Speech Monitor\Presets\<PRESETNAME>.Preset.xml

“Stop text-to-speech” macro and hotkey setup in “World of Warcraft” (optional).

1. Game Menu > [ Macros ] > [ New ]
2. Enter macro name (for example: “Stop TTS”).
3. Choose an icon for macro.
4. Click [ Okay ] button.
5. Write in “Enter Macro Commands” field:

/run SendChatMessage("<message command=\"stop\" />", "WHISPER", "Common", UnitName("player"))

6. Click [ Save ] button.
7. Drag “Stop TTS” macro icon from “General Macros” tab on “Action Bar” button.
8. Click [ Exit ] button.

9. Game Menu > [ Key Bindings ] > [ Action Bar ]
10. Bind desired keyboard key to "Action Bar" button with “Stop TTS” macro.
After pressing this key on keyboard, text-to-speech will stop.

Problems and solutions

“Network” mode doesn’t work with 8.x WoW game. Administrator rights are required for “Network” mode (“Run as administrator”). User Account Control window must show “Verified Publisher: Jocys.com” or “Verified Publisher: Evaldas Jocys”. Do not trust executables from “Publisher: Unknown”. “Monitor” may not work with “Internet Protocol Version 6” (IPv6). To test this, you can temporary disable IPv6:

Disable IPv6 in “World of Warcraft” game:

1. WoW Main Menu > System > Network > Uncheck (disable) “[ ] Enable IPv6 when available” check-box.
2. Restart WoW game.

Disable IPv6 on your network card in Windows (don’t forget to enable IPv6 again later):

1. Close WoW game and “Monitor”.
2. Click [Win]+[X] keyboard keys together.
3. Select “Control Panel” from menu.
4. Select “Small icons” in “View by:” drop-down menu.
5. Find and select “Network and Sharing Centre”.
6. Click on “Change adapter settings”.
7. Click with second mouse button on network card, you are using.
8. Select “Properties” from menu.
9. Uncheck (disable) “Internet Protocol Version 6”.
10. Click [ OK ] button.
11. Run WoW game and “Monitor”.

Cache Options in “Monitor” (Create text-to-speech audio files)

If your computer is slow, you can use “Monitor’s” “Cache Options” to write and read audio files. The next time, when you will encounter the same dialogue-text, “Monitor” will not use TTS voices and will not create audio file again, but will play instantly previously created audio file instead. If you put custom recorded MP3 file with the same name then "Monitor" will play MP3 file, instead of WAV.

“Monitor” > [Options] tab > “Cache Options” section

Audio files directory: C:\ProgramData\Jocys.com\Text to Speech Monitor\Cache\

Desired improvements in “World of Warcraft” game

• Getting UnitSex of NPC from chat and quest log -- no need to select it to get gender.
• Getting UnitAge of NPC (%) -- (1-100) in order to apply “Child", “Adult” or “Senior” effects.
• Getting UnitRace of NPC -- Sound effects on NPCs are applied by UnitCreatureType now.
• Getting value if NPC has voice over for all text -- in order not to start TTS speech.
• NPC “talking” animation should loop, depending on length of the text.

TTS Monitor (XML)

Simple message example:

<message command="play"><part>text</part></message>

For TTS Monitor to speak in different voices, you must have text-to-speech voices installed on your operating system and Addon must submit game character name (example: "Marshal McBride") and/or gender ("Male", "Female", "Neutral") values. Example:

<message name="Marshal McBride" gender="Male" command="play"><part>text</part></message>

If submited name is name of text-to-speech voice, like "IVONA 2 Amy", it is not necessary to submit gender value.

If name value is not submitted, text-to-speech voice with highest popularity value (of specified gender, if gender value is submitted) in TTS Monitor > [ Voices ] tab will be used.

If gender value is not submitted or submitted value is not "Male", "Female" or "Neutral", selected gender in TTS Monitor > [ Voices ] tab > [ Default · My Gender ] drop-down box will be used.

Submited values have priority over local settings. If you will submit values, TTS Monitor will use submited values and will ignore local (default) settings.

Advanced message example:

<message name="Marshal McBride" gender="Male" effect="Humanoid" group="Quest" pitch="-5" rate="1" volume="100" command="play"><part>text[comment]text[/comment]</part></message>

[comment]text[/comment] -- In Monitor will be replaced with SAPI XML <pitch absmiddle="(inverted pitch value 8 or -8)" />text<pitch absmiddle="(original pitch value)" />.

name -- Can be text-to-specch voice name, like "IVONA 2 Brian" - TTS Monitor will use it. Can be game character name, like "Marshal McBride" - TTS Monitor will assign text-to-speech voice to this character name.
gender -- Voice gender... "Male", "Female" or "Neutral".
pitch -- Voice pitch... value from "-10" to "10".
rate -- Voice speed... value from "-10" to "10".
volume -- Voice volume... value from "0" to "100".
effect -- Voice (sound card) effects... "Dragon", "Undead", "Mechanical", etc.. You can add, edit and delete sound card effects in TTS Monitor.

group -- Message in TTS Monitor will be assigned to specific group, if group value is submitted ("Quest", "Whisper", "RaidLeader", etc...).
language -- Will select specific language voices... "de-DE", "en-GB", "en-US", "es-ES", "fr-FR", "ko-KR", "ru-RU" or "809", "409", etc..

command -- "add", "play", "stop", "sound", "save". Examples:

You can play splitted message (if there is 255 character limitation in game) with command="add" and command="play".

<message command="add"><part>text</part></message> -- First part of message.
<message command="add<part>text</part></message> -- Second part of message.
<message command="play"><part>text</part></message> -- Third-last part of message.

Stop text-to-speech and remove message(s) from TTS Monitor’s playlist with command="stop".

<message command="stop" /> -- Stop text-to-speech and remove all messages from TTS Monitor’s playlist.
<message command="stop" group="Quest" /> -- Stop text-to-speech and remove all "Quest" group messages from TTS Monitor’s playlist.

Play (intro) audio sound with command="sound" and group value. Sound must be listed and enabled in TTS Monitor > [ Intro Sounds ] tab.

<message command="sound" /> -- Audio, selected in [ Default Intro Sound ] drop-down box, will be played.
<message command="sound" group="Whisper" /> -- Audio, assigned to "Whisper" group, will be played.

Included in Monitor sound names are listed in TTS Monitor > [ Default Intro Sound ] drop-down box.
Also, you can specify custom paths to WAV files, like C:\Windows\Media\notify.wav

You can save name, gender and effect values in TTS Monitor > [ Voice Defaults ] tab with command="save".

<message command="save" name="Thomas Miller" gender="Male" effect="Humanoid" />

TTS Monitor settings directory: C:\ProgramData\Jocys.com\Text to Speech Monitor\

Port numbers for “Network“ mode

3724 -- World of Warcraft.

Acronyms

Key-Regex values are .NET Framework Regular Expressions.

WoW Addon Example · Download 1.0 (2019-10-20)

You can use Digit Zero 0 or Middle Dot · as pixel.
JocysCom0AsPixelSpace.ttf
JocysCom0AsPixel.ttf -- WoW Addon uses this font.

Disable “Jocys.com Text to Speech WoW”
Enable “JocysCom Text to Speech WoW Example”


WoW Addon (*.TOC)

## Author: Jocys.com
## Interface: 80205
## Notes: Jocys.com TTS WoW AddOn Example
## Title: |cff77ccffJocys.com|r TTS Example
## Version: 8.2.5
JocysCom-TextToSpeech-WoW-Example.xml
JocysCom-TextToSpeech-WoW-Example.lua

WoW Addon (*.LUA)

-- Message prefix for TTS Monitor to find pixel line on display. 6 coloured characters-pixels.
-- (|c) color starts, (##) alpha, (##) red, (##) green, (##) blue, (·) character-pixel, (|r) color ends.
local messagePrefixPixels = "|cff220000·|r|cff002200·|r|cff000022·|r|cff220000·|r|cff002200·|r|cff000022·|r"
-- Table (list) for adding and removing messages.
local messageTable = {}
-- Message change color value. For Monitor to know, when message was changed.
local messageChanged = math.random(10, 80)
-- TTS Monitor checks display with 100 millisecond intervals.
-- Send and remove message(s) from table with 500 millisecond intervals.
local messageInterval = 0.5

function JocysCom_PlayButton_OnClick()
local sendMessage = "Hello World!"
if #JocysCom_MessageEditBox:GetText() > 0 then
sendMessage = JocysCom_MessageEditBox:GetText()
end
JocysCom_MessageEditBox:SetText(sendMessage)
JocysCom_AddMessageToTable("<message command=\"play\"><part>" .. sendMessage .. "</part></message>")
end

function JocysCom_StopButton_OnClick()
JocysCom_AddMessageToTable("<message command=\"stop\" />")
end

function JocysCom_AddMessageToTable(messageText)
table.insert(messageTable, messageText)
end

function JocysCom_SendMessageFromTable()
-- Convert message characters to bytes (UTF-8). a ш B Ш C • 61 D188 42 D0A8 43 • 61D18842D0A843
local messageBytes = messageTable[1]:gsub(".", function(v) return string.format("%02x", string.byte(v)) end)

-- Count bytes-pairs (7). 61 D1 88 42 D0 A8 43
local messageLen = #messageBytes / 2
-- Create message length value-color (3 bytes). Add missing bytes.
local messageLenBytes = string.format("%06x", messageLen)
-- Create message lenght character-pixel.
local messageLenPixel = "|cff" .. messageLenBytes .. "·|r"

-- Divide message (7) into 3 byte groups and get ungrouped byte(s) • (7)-3-3=1 left • (61D188) (42D0A8) 43
local ungroupedBytes = math.fmod(messageLen, 3)
-- If ungrouped bytes left, add missing bytes. "00" or "0000".
if ungroupedBytes > 0 then
messageBytes = messageBytes .. string.rep("00", 3 - ungroupedBytes)
end
-- Get (3 byte) groups. Switch red color with blue (RGB > BGR). Create coloured pixels. |cff88D161·|r
local messagePixels = messageBytes:gsub("(..)(..)(..)", "|cff" .. "%3%2%1" .. "·|r")

-- Update message change indicator color for Monitor: add 1 to red, green and blue.
messageChanged = messageChanged + 1
-- Do not exceed color brightness #808080.
if messageChanged > 80 then messageChanged = 10 end
-- Create message change character-pixel. |cff101010·|r
local messageChangedPixel = "|cff" .. string.rep(messageChanged, 3) .. "·|r"

-- Create final message with prefixes: prefix(6px) + change(1px) + size(1px) + message(#px)
local message = messagePrefixPixels .. messageChangedPixel .. messageLenPixel .. messagePixels
-- Show message on display.
JocysCom_ColorMessageEditBox:SetText(message)
-- Remove message from table.
table.remove(messageTable, 1)
end

function JocysCom_SendMessageTimer()
if #messageTable > 0 then JocysCom_SendMessageFromTable() end
-- Wait #.# second and check messageTable.
C_Timer.After(messageInterval, JocysCom_SendMessageTimer)
end
JocysCom_SendMessageTimer()

WoW Addon (*.XML)

<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/ ..\FrameXML\UI.xsd">

<!-- Pixel Line -->
<EditBox name="JocysCom_ColorMessageEditBox" parent="WorldFrame" frameStrata="HIGH" ignoreParentScale="true" movable="false" enableMouse="false" letters="0" multiLine="true" autoFocus="false" ignoreArrows="true" clampedToScreen="false">
<Size y="2" />
<Anchors>
<Anchor point="TOPLEFT" />
<Anchor point="TOPRIGHT" />
</Anchors>
<Layers>
<Layer>
<Texture>
<Color a="1" r="0" g="0" b="0" />
</Texture>
</Layer>
</Layers>
<FontString justifyH="LEFT" font="Interface/AddOns/JocysCom-TextToSpeech-WoW-EXAMPLE/Fonts/JocysCom0AsPixel.ttf" wordwrap="true" spacing="0" nonspacewrap="true" ignoreParentScale="true">
<FontHeight val="1" />
</FontString>
</EditBox>

<!-- Frame -->
<Frame name="JocysCom_ColorMessageFrame" inherits="BasicFrameTemplate" parent="UIParent" movable="true" frameStrata="HIGH">
<Size x="400" y="87" />
<Anchors>
<Anchor point="CENTER" />
</Anchors>
<Frames>

<!-- Message Box -->
<EditBox name="JocysCom_MessageEditBox" inherits="InputBoxTemplate" letters="0" autofocus="false">
<Size x="375" y="20" />
<Anchors>
<Anchor point="BOTTOM" x="1" y="38" />
</Anchors>
<Scripts>
<OnLoad>
self:SetText("Hello World!")
</OnLoad>
</Scripts>
</EditBox>

<!-- Play Button -->
<Button inherits="UIPanelButtonTemplate" text="PLAY">
<Size x="50" y="22" />
<Anchors>
<Anchor point="BOTTOMRIGHT" relativePoint="BOTTOM" y="10" />
</Anchors>
<Scripts>
<OnClick>
JocysCom_PlayButton_OnClick();
JocysCom_MessageEditBox:ClearFocus();
</OnClick>
</Scripts>
</Button>

<!-- Stop Button -->
<Button inherits="UIPanelButtonTemplate" text="STOP">
<Size x="50" y="22" />
<Anchors>
<Anchor point="BOTTOMLEFT" relativePoint="BOTTOM" y="10" />
</Anchors>
<Scripts>
<OnClick>
JocysCom_StopButton_OnClick();
JocysCom_MessageEditBox:ClearFocus();
</OnClick>
</Scripts>
</Button>

</Frames>
<Scripts>
<OnLoad>
self:RegisterForDrag("LeftButton");
self.TitleText:SetText("Jocys.Com Text to Speech Example 1.0 (2019-10-20)")
</OnLoad>
<OnDragStart>
self:StartMoving();
</OnDragStart>
<OnDragStop>
self:StopMovingOrSizing();
</OnDragStop>
</Scripts>
</Frame>

</Ui>