Thread View: borland.public.csharpbuilder.multimedia
4 messages
4 total messages
Started by Joe Gabriele
Thu, 13 Apr 2006 23:32
TTS with C#
Author: Joe Gabriele
Date: Thu, 13 Apr 2006 23:32
Date: Thu, 13 Apr 2006 23:32
19 lines
1663 bytes
1663 bytes
Hi, I've put together a small application in C# that converts text files into speech. It appears to work quite well with one exception. There doesn't seem to be a way to stop the speech process once it has begun with the line Voice.Speak(SpeakText.Text, SpFlags);. You can Pause() and Resume() but you can't stop. I have found some articles on the web that say one way of doing it is to call Voice.Speak again with a null string as the text file and SVSFPurgeBeforeSpeak as the flag. The problem is that these articles are all talking about C++. C# doesn't understand what SVSFPurgeBeforeSpeak is. Would anyone have any ideas or be able to point me to some documentation that covers this? Thanks Joe Gabriele
Re: TTS with C#
Author: Marc Rohloff TeamB
Date: Fri, 14 Apr 2006 01:40
Date: Fri, 14 Apr 2006 01:40
21 lines
1908 bytes
1908 bytes
On Thu, 13 Apr 2006 19:32:20 -0400, Joe Gabriele wrote: > Hi, > > I've put together a small application in C# that converts text files into > speech. It appears to work quite well with one exception. There doesn't seem > to be a way to stop the speech process once it has begun with the line > Voice.Speak(SpeakText.Text, SpFlags);. You can Pause() and Resume() but you > can't stop. > > I have found some articles on the web that say one way of doing it is to > call Voice.Speak again with a null string as the text file and > SVSFPurgeBeforeSpeak as the flag. The problem is that these articles are all > talking about C++. C# doesn't understand what SVSFPurgeBeforeSpeak is. Its a predefined constant, a quick Google search turns up its value as 2. -- Marc Rohloff [TeamB] marc rohloff -at- myrealbox -dot- com
Re: TTS with C#
Author: Marc Rohloff TeamB
Date: Fri, 14 Apr 2006 01:45
Date: Fri, 14 Apr 2006 01:45
11 lines
1354 bytes
1354 bytes
On Thu, 13 Apr 2006 21:40:17 -0400, Marc Rohloff [TeamB] wrote: > Its a predefined constant, a quick Google search turns up its value as > 2. Here's one using C# http://www.emant.com/676008.page -- Marc Rohloff [TeamB] marc rohloff -at- myrealbox -dot- com
Re: TTS with C#
Author: Joe Gabriele
Date: Fri, 14 Apr 2006 02:53
Date: Fri, 14 Apr 2006 02:53
40 lines
2203 bytes
2203 bytes
Hello Marc,
Thanks for replying. I had already found through Google that it's value was
2 and tried the following code:
private void StopButton_Click(object sender, System.EventArgs e)
{
string SN = "";
Voice.Speak(SN,2);
}
This, however, did not work so I knew I was doing something wrong. With help
from the URL you provided, the code below now works perfectly.
private void StopButton_Click(object sender, System.EventArgs e)
{
string SN = "";
Voice.Speak(SN,SpeechVoiceSpeakFlags.SVSFPurgeBeforeSpeak);
}
I'm still pretty green using C# as I've been a Pascal/Delphi man since the
mid 70's. I am, however, learning thanks to the help from people like you.
Regards...
Joe Gabriele
"Marc Rohloff [TeamB]" <"on request"> wrote in message
news:9lb0olm4235d.dlg@dlg.marcrohloff.com...
> On Thu, 13 Apr 2006 21:40:17 -0400, Marc Rohloff [TeamB] wrote:
>
>> Its a predefined constant, a quick Google search turns up its value as
>> 2.
>
> Here's one using C#
> http://www.emant.com/676008.page
>
> --
> Marc Rohloff [TeamB]
> marc rohloff -at- myrealbox -dot- com
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads