Text to Speech output on PC

Thread Starter

John P

Joined Oct 14, 2008
2,051
On a related topic, does anyone know a way (using C functions from some library) to get audio output from a computer? What I'd like to find would be a function like SpeakText(char *my_text) where you send it a text string that gets read out audibly. But it mustn't block the operation of the computer while the output occurs, and if a second (or more) string gets sent while the first one is being spoken, the later ones would be queued and spoken out in turn. Or perhaps there could be a flag for "Cancel outgoing text" if you wanted to flush the queue of phrases waiting to be spoken. I looked for a way to do this and never found anything exactly right.
 

Thread Starter

John P

Joined Oct 14, 2008
2,051
Not close enough to existing thread? OK then.

Getting the computer to use text-to-speech mode while not pausing execution of anything else seemed basic enough, but I was never able to find anything that worked exactly the way I wanted. Eventually I found some software that a guy was giving away (no longer available) and it was adequate, but it was more hassle than I really liked, and it runs as an adjunct program, rather than just a callable function. Perfection is still out there waiting.
 

Thread Starter

John P

Joined Oct 14, 2008
2,051
What is your platform? Windows 10?
Does this help?
Windows 7.

Thanks, but that's not what I'm looking for. I have Balabolka (Russian for "babbler") and it's good at what it does, but it takes input from a file, or by cut-and-paste into a window. What I want is a method that lets my own program speak an arbitrary text string--call it "the audio version of printf()". And as I said, I want it to not block the code while the output is spoken, and concatenate strings if I send more than one, not interrupt one string with another. This all seems reasonably basic, but I haven't found code that will do it.
 

MrChips

Joined Oct 2, 2009
34,629
Hi John,
All along I suspected that that was what you wanted. I was just checking to make certain. I wasn't sure if it was for Win OS or an embedded system.

What you will need is a Text-to-Speech engine (or library). I have a friend who is visually impaired. I will see what he has used in the past.
 

MrSoftware

Joined Oct 29, 2013
2,273
Getting it to not block while the speech happens doesn't need to be a feature of the library or whatever speaking code you find, just run that part of your program in another thread.
 
Top