I have been trying to integrate the Text-to-Speech Tutorial (SAPI 5.3) from Microsoft msdn site http://msdn.microsoft.com/en-us/library/ms720163%28v=vs.85%29 and just cant figure it out. I am trying to get the program to turn the text it outputs into the cmd window in to speech. Its just a little project I have been working on and any help would be great thanks. I all ready have the #included files I need in the beginning of the code. I am still new at c++ but I am able to write some very neat cmd programs but this Text to speech just stumps me, thanks. just a person trying to learn something new.
The problem is with line 25. Declare nSelection outside of it.
There was also crashing when trying to access an element ouside of Response[] range. Response[] is created with '3' elements. Namely 0, 1, 2, 3. But rand() % 5 will give a range of 0 to 4...see the problem ?
I took the liberty to make the changes here :D
@Cye
The link you posted has working examples and it should be fairly simple to adapt your program to use it. Specifically look at step 4. Heres my simple example
Thanks for all the help so far and the fast responses, will look in to this later to day and see if I can solve this after all, will let ya know thanks again.
soranz
I made that statment even simpler ass you stated was possible bye adding using namespace std; and removing all the std:: from my code.
This is also possible: cout << Response[rand() % 5] << endl;
But, for ur own readability it might make more sense not to do this - I just wanted to point it out XD