Home All Groups Group Topic Archive Search About

Adding Text- to -Speech functionality (SAPI 5) to my app

Author
28 May 2009 5:24 PM
fred
Hello,
             I am novice using TTS.
What should I do to add SAPI 5 functionalty to my app?
Is there any ready component or reference I can use?
What about Ms run time libraries? Are they available for free download?
Thanks,
Fred

Author
28 May 2009 11:33 PM
mayayana
There's an SpVoice object that's fairly simple
to use. There's also an SDK that comes with
basic samples. If you're only writing
for XP+ then SAPI5 is pre-installed. If you
need to support earlier systems Microsoft
has no official way to install TTS support without
building an MSI. But others have made
installers for it, of 10MB or less.

  If you start with this download:
SpeechSDK51.exe
from here:
http://www.microsoft.com/downloads/details.aspx?FamilyID=5e86ec97-40a7-453f-
b0ee-6583171b4530&displaylang=en

you should find what you need.

Show quoteHide quote
> Hello,
>              I am novice using TTS.
> What should I do to add SAPI 5 functionalty to my app?
> Is there any ready component or reference I can use?
> What about Ms run time libraries? Are they available for free download?
> Thanks,
> Fred
>
Author
30 May 2009 6:47 PM
fred
Thank you.
I have downloaded and installed SDK 5.1 on my computer.
I do not know, which reference should I use:
MS TTS Engine 1.0 Type Library
or
Microsoft Voice Text
or
Microsoft Speech Object Library
?
Please advise,
Fred

Show quoteHide quote
"mayayana" <mayaXXy***@rcXXn.com> wrote in message
news:%23JDuR0%233JHA.1716@TK2MSFTNGP03.phx.gbl...
>  There's an SpVoice object that's fairly simple
> to use. There's also an SDK that comes with
> basic samples. If you're only writing
> for XP+ then SAPI5 is pre-installed. If you
> need to support earlier systems Microsoft
> has no official way to install TTS support without
> building an MSI. But others have made
> installers for it, of 10MB or less.
>
>  If you start with this download:
> SpeechSDK51.exe
> from here:
> http://www.microsoft.com/downloads/details.aspx?FamilyID=5e86ec97-40a7-453f-
> b0ee-6583171b4530&displaylang=en
>
> you should find what you need.
>
>> Hello,
>>              I am novice using TTS.
>> What should I do to add SAPI 5 functionalty to my app?
>> Is there any ready component or reference I can use?
>> What about Ms run time libraries? Are they available for free download?
>> Thanks,
>> Fred
>>
>
>
>
Author
31 May 2009 2:37 AM
mayayana
Microsoft Speech Object Library
SAPI.dll

  I haven't used this for awhile and don't remember
the details so well, but here's a basic sample. The
most notable point is the flags used for the Speak
method. Read up on that to see your options. Also,
see the samples from the SDK for more sample code.

'-------------This code in a form with a button ---------

Dim Voice As SpVoice

Private Sub Command1_Click()
Dim SpToken As ISpeechObjectToken
Dim sV1 As String, s As String
Dim Boo As Boolean

  With Voice
    .Volume = 100  ' full volume.
      For Each SpToken In .GetVoices
       sV1 = SpToken.GetDescription
          If sV1 = "Microsoft Mary" Then
             Set .Voice = SpToken
             Exit For
          End If
       Next
    .AllowAudioOutputFormatChangesOnNextSet = False
    .AudioOutputStream.Format.Type = 22  'SAFT22kHz16BitMono
      Set .AudioOutputStream = .AudioOutputStream
      s = "This is a test string to be spoken by Microsoft Mary."
    .Speak s, 3  '-- see the SpeechVoiceSpeakFlags Enum for
                  '-- this important flag.
                  '-- 3 is SVSFlagsAsync Or SVSFPurgeBeforeSpeak
End With
  '-- why was this here? I don't remember. :)
  'Boo = Voice.WaitUntilDone(-1)

End Sub

Private Sub Form_Load()
Set Voice = New SpVoice
End Sub

Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
Set Voice = Nothing
End Sub
'-------------------------------------------