text to speech, tts

a8le

Well-known member
Joined
Oct 27, 2005
Messages
75
Programming Experience
5-10
Hi all,

I am stuck augmenting my site with tts. I have read numerous tutorials and search the web for weeks now and still can't get anything to work.

So far this is what I have done...

Added a reference to: Interop.SpeechLib.dll
Imported: SpeechLib
Made an instance of the voice: Dim voice As New SpVoice()
Put in fake text: voice.Speak("Say Something.")

All together now...
VB.NET:
        Private Sub lbtnTTS_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles lbtnTTS.Click
            Try
                Dim voice As New SpVoice
                voice.Speak("Say Something.", SpeechVoiceSpeakFlags.SVSFDefault)
            Catch exc As Exception
                Response.Write(exc.ToString)
            End Try
        End Sub

What's even more odd is the fact that my exception is blank.

Please point me in the right direction...

Thanks.
 
Tts

Why not add a reference to system.speech and use the following

Dim voice As New Speech.Synthesis.SpeechSynthesizer
voice.Speak("Say Something.")
 
Greyed Out?

I just created a web Project added a simple button to the default.aspx page,

Added a reference to system.speech then

In the code behind for the button add the following code

Dim v As New Speech.Synthesis.SpeechSynthesizer
v.Speak("Welcome to the web")

You will need to also set the page Async= true as like to following

<%@ Page Language="vb" AutoEventWireup="false" Async="true" CodeBehind="Default.aspx.vb" Inherits="SpeachWeb._Default" %>

Run and you should hear the voice when button pressed
 
System.Speech is part of .Net 3.0, is your web app targeting .Net 2.0 perhaps? I also can add reference to it in my .Net 3.5 web app.
 
Back
Top