Text to Speech is very usefull in Web Application as well as in windows application.Microsoft provide Speech Object Library that is use for this purpose.Here i have mention steps to implement text to speech in C#.
1). Add Speech Object Library reference to your Application using right click on Project & click on Add Reference.
2). After Adding Referece of Speech Object Library Drag one textbox control on your WinForm & give the name txttexttospeech.
3). After that put this belowed code on your page load event of the form.
1: SpVoice voice = new SpVoice();2: voice.Voice = voice.GetVoices("Name=LH Michael", "Language=409").Item(0);3: voice.Speak(txttexttospeech.Text, SpeechVoiceSpeakFlags.SVSFDefault);
Text to Speech In C#
September 16, 2008 by dhavalshah
Dear,
Good Job…….
Very Good ….
Carry on..
Text to Speech is indeed a very cool thing and it’s so easy to integrate in .NET. I never figured out how those language files are synthesized… But as long as it’s easy to code, it’s great!
hi.. can you tell me the procedure and namespaces to implement text to speech in webapplication. And thats a good work that you have done in windows application.
Thanks
hi dear,
I like your posts
they are very useful.
I want to ask you something
could you add me plz
or give me your id
this is my id
yourbelover@gmail.com
I have done the c# text to speech project but its giving 1 error + 89 warnings. they are. how to correct this during set up it says to exclude sapi.dll . i’m in urgent plz help me ..
Error 90 ’sapi.dll’ should be excluded because its source file ‘C:\Program Files\Common Files\Microsoft Shared\Speech\sapi.dll’ is under Windows System File Protection. C:\Documents and Settings\Administrator.SERVER\Desktop\siren withou talk\Siren\Setup1\Setup1.vdproj Setup1
Warning 1 At least one of the arguments for ‘SpObjectTokenCategory.GetStringValue’ cannot be marshaled by the runtime marshaler. Such arguments will therefore be passed as a pointer and may require unsafe code to manipulate. Siren
Warning 2 At least one of the arguments for ‘SpObjectTokenCategory.EnumKeys’ cannot be marshaled by the runtime marshaler. Such arguments will therefore be passed as a pointer and may require unsafe code to manipulate. Siren
Warning 3 At least one of the arguments for ‘SpObjectTokenCategory.EnumValues’ cannot be marshaled by the runtime marshaler. Such arguments will therefore be passed as a pointer and may require unsafe code to manipulate. Siren
Warning 4 At least one of the arguments for ‘SpObjectTokenCategory.GetId’ cannot be marshaled by the runtime marshaler. Such arguments will therefore be passed as a pointer and may require unsafe code to manipulate. Siren
Warning 5 At least one of the arguments for ‘SpObjectTokenCategory.GetDefaultTokenId’ cannot be marshaled by the runtime marshaler. Such arguments will therefore be passed as a pointer and may require unsafe code to manipulate. Siren
Warning 6 At least one of the arguments for ‘ISpObjectTokenCategory.GetStringValue’ cannot be marshaled by the runtime marshaler. Such arguments will therefore be passed as a pointer and may require unsafe code to manipulate. Siren
Warning 7 At least one of the arguments for ‘ISpObjectTokenCategory.EnumKeys’ cannot be marshaled by the runtime marshaler. Such arguments will therefore be passed as a pointer and may require unsafe code to manipulate. Siren
Warning 8 At least one of the arguments for ‘ISpObjectTokenCategory.EnumValues’ cannot be marshaled by the runtime marshaler. Such arguments will therefore be passed as a pointer and may require unsafe code to manipulate. Siren
follows……
dear u dint mention the namespace to be added.
this is a nice article to implement text to speech web application. Thanks a lot for sharing your knowledge.
when I put in public server, We couldn’t call from client machine. It means not working.
Please tell me detail of your error.
so i can help you.