WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

SAPI

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Specifying SAPI Voice

 Keywords: SAPI Sapi.SpVoice GetVoices 

Question:

What am I doing wrong? Trying to adapt this from some vb script. I think I'm messing up the WIL syntax. F = ObjectCreate("Sapi.SpVoice"); F.Voice = F.GetVoices("gender=female").Item(0) F.Speak("test")

Answer:

The code basically looks okay. However, your code could fail if you do not have any female voices installed. Try running this code to see what voices are installed:
oSpVoice = ObjectCreate("Sapi.SpVoice");
colVoices = oSpVoice.GetVoices
count = colVoices.count-1
For xx  = 0 To count
     voice = colVoices.Item(xx).GetDescription
     say = 'This voice is ': voice
     oSpVoice.Voice = oSpVoice.GetVoices(StrCat('Name=', voice)).Item(0)
     oSpVoice.Speak(say)
Next
Exit

Article ID:   W18180
Filename:   Specifying SAPI Voice.txt
File Created: 2009:06:25:09:21:18
Last Updated: 2009:06:25:09:21:18