“man say” in the terminal has the option of --interactive. I tired it out in the terminal and pretty cool.
" Print the text line by line during synthesis, highlighting words as they are spoken"
In my app I open text file and display the text and have an option to speak the text by passing the text or the selected text to s.Execute("say " + sometext) How can I have my app highlight the text in the textarea as its being spoken like with the --interactive option?
Use an interactive shell,
in the dataAvaliable event you will have your string with some control codes
find the position of the start hi light IE [7m and the position of the ending one IE (B
considering the offset: the string has a [M extra and if you have more lines you will have to shift for the current line of text since say replies are relative to the current line (endofline)
Hilight as you wish the text in your textArea