473,386 Members | 2,042 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Text to speech

Hi,

I am running VB6 under windows XP Professional.. I added the 'Microsoft
Direct Text-To-Speech' component, named it spkSpeak and added the following
code in Form(Load): spkSpeak.Speak "You have selected Microsoft Sam.".

The weird thing is that when I run the program nothing happens.
Microsoft Sam is automatically installed when windows is installed, there
must be some way to use this function. Does anyone here knows how it can be
used in a VB application? (preferably without installing other programs)

Thanks,

Chris
Jul 17 '05 #1
2 21504
I don't know what component you're talking about. Maybe it's
an OCX in XP because of SAPI5 being built in. But if you're
using SAPI 5 you just need a reference to SAPI.DLL:
"Microsoft Speech Object Library"

I'd be inclined to connect it with a button rather than form load,
just to rule out other unforseen problems - since you probably don't
want your program talking while it's loading anyway.

Also, you'll find samples in the SAPI SDK. (Big download. You'll
need to have or borrow a high speed connection.)

Note that support for SAPI5 is only in XP. The minimum shipping
support size for other systems is 6-10 MB worth of DLLs, etc. and it's
rigged not to run on Win95.

'-- The Enums:

Enum SpeechVoiceSpeakFlags
SVSFDefault = 0
SVSFlagsAsync = 1 '--speak asynchronously.
SVSFPurgeBeforeSpeak = 2 '--purge pending speech.
SVSFIsFilename = 4
SVSFIsXML = 8
SVSFIsNotXML = 16
SVSFPersistXML = 32
SVSFNLPSpeakPunc = 64 '--speak punctuation as word: "blah blah period"
'-- Masks
SVSFNLPMask = 64
SVSFVoiceMask = 127
SVSFUnusedFlags = -128
End Enum

'-- This flag may not be what you want but it's a sanmple.
'-- It will make TTS keep up with events rather than finish speaking it's
'-- buffer before moving on. For instance, if you set it to speak 500
'-- names and then tell it halfway through to speak 500 numbers instead,
'-- ASync will cause it to stop reading names and switch to numbers.
'-- Not-Async will cause it to finish with the names first.

Const SPEAK_FLAGS_1 = SVSFlagsAsync Or SVSFPurgeBeforeSpeak Or SVSFIsNotXML

Public SpkVoice As SpVoice

'-- Public sub that can be called to speak provided string:

Public Sub SpeakIt(sText As String)
On Error Resume Next
If (Len(sText) = 0) Then Exit Sub
SpkVoice.Speak sText, SPEAK_FLAGS_1
End Sub
--
--
Chris <c9*****@hotmail.com> wrote in message
news:f3***************************@news.multikabel .nl...
Hi,

I am running VB6 under windows XP Professional.. I added the 'Microsoft
Direct Text-To-Speech' component, named it spkSpeak and added the following code in Form(Load): spkSpeak.Speak "You have selected Microsoft Sam.".

The weird thing is that when I run the program nothing happens.
Microsoft Sam is automatically installed when windows is installed, there
must be some way to use this function. Does anyone here knows how it can be used in a VB application? (preferably without installing other programs)

Thanks,

Chris

Jul 17 '05 #2
(300MB? It's nice being a network administrator with a T1 at work...)

Anyone know how to add voices to the SAPI 5.1 system? I need Japanese
language support, and all I can seem to find is the speech recognition
component. I need a voice capable of Japanese TTS.

Any help is greatly appreciated! Thanks!!
"mayayana" <ma************@mindZZspring.com> wrote in message
news:o3*****************@newsread2.news.atl.earthl ink.net...
I don't know what component you're talking about. Maybe it's
an OCX in XP because of SAPI5 being built in. But if you're
using SAPI 5 you just need a reference to SAPI.DLL:
"Microsoft Speech Object Library"

I'd be inclined to connect it with a button rather than form load,
just to rule out other unforseen problems - since you probably don't
want your program talking while it's loading anyway.

Also, you'll find samples in the SAPI SDK. (Big download. You'll
need to have or borrow a high speed connection.)

Note that support for SAPI5 is only in XP. The minimum shipping
support size for other systems is 6-10 MB worth of DLLs, etc. and it's
rigged not to run on Win95.

'-- The Enums:

Enum SpeechVoiceSpeakFlags
SVSFDefault = 0
SVSFlagsAsync = 1 '--speak asynchronously.
SVSFPurgeBeforeSpeak = 2 '--purge pending speech.
SVSFIsFilename = 4
SVSFIsXML = 8
SVSFIsNotXML = 16
SVSFPersistXML = 32
SVSFNLPSpeakPunc = 64 '--speak punctuation as word: "blah blah period" '-- Masks
SVSFNLPMask = 64
SVSFVoiceMask = 127
SVSFUnusedFlags = -128
End Enum

'-- This flag may not be what you want but it's a sanmple.
'-- It will make TTS keep up with events rather than finish speaking it's
'-- buffer before moving on. For instance, if you set it to speak 500
'-- names and then tell it halfway through to speak 500 numbers instead,
'-- ASync will cause it to stop reading names and switch to numbers.
'-- Not-Async will cause it to finish with the names first.

Const SPEAK_FLAGS_1 = SVSFlagsAsync Or SVSFPurgeBeforeSpeak Or SVSFIsNotXML
Public SpkVoice As SpVoice

'-- Public sub that can be called to speak provided string:

Public Sub SpeakIt(sText As String)
On Error Resume Next
If (Len(sText) = 0) Then Exit Sub
SpkVoice.Speak sText, SPEAK_FLAGS_1
End Sub
--
--
Chris <c9*****@hotmail.com> wrote in message
news:f3***************************@news.multikabel .nl...
Hi,

I am running VB6 under windows XP Professional.. I added the 'Microsoft
Direct Text-To-Speech' component, named it spkSpeak and added the

following
code in Form(Load): spkSpeak.Speak "You have selected Microsoft Sam.".

The weird thing is that when I run the program nothing happens.
Microsoft Sam is automatically installed when windows is installed, there must be some way to use this function. Does anyone here knows how it can

be
used in a VB application? (preferably without installing other programs)

Thanks,

Chris



Jul 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Charles Hartman | last post by:
Does anyone know of a cross-platform (OSX and Windows at least) library for text-to-speech? I know there's an OSX API, and probably also for Windows. I know PyTTS exists, but it seems to talk only...
0
by: David M | last post by:
I am attempting to access the text to speech SDK via. C#. I setup a reference to the "Microsoft Voice Text" Control (vtext.dll) and I added the following code: HTTSLib.TextToSpeechClass v = new...
5
by: Rod | last post by:
About two weeks ago I had an accident and have broken my left elbow and left wrist. For doing things like Word or e-mail (I use Outlook for) I have been using Microsoft's speech recognition and...
17
by: MLH | last post by:
From time to time, I find myself cross checking one block of code against another. Usually older stuff in which I've made modifications that don't work. I don't remember what all the changes were...
1
by: zoneal | last post by:
i'm developing a text-to-speech for my system. i use the text-to-speech component from the .net. but the voice sometimes is mary and sometimes is sam. Is there any way to default the voice i use in...
2
by: Onur | last post by:
Hi.All I'm working on a TTS application. It runs on my local pc (WindowXP pro) without any error. Microsoft Visual Studio .NET 2003, Microsoft .NET Framework SDK v1.1, Microsoft Speech...
6
by: rolf.oltmans | last post by:
Hello, I am working on an web-based application where users will give their input in form of speech using microphone and I've to show whatever they spoke in text in a textbox, how is that...
1
by: Hakan Fatih YILDIRIM | last post by:
Hi List! i am making a project and i want the text in speech mode so idownload a .net speech library from code project.But i have to make the speech in Turkish accent.How can i change the speech...
5
by: kimiraikkonen | last post by:
Hi all, In Visual Basic 2005, i added "textToSpeech Class" from COM Components and i dragged it onto my form as a ActiveX control with no problem. The problem is that it doesn't do what it claims....
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.