Sign in to follow this  
Followers 0
Tukata

Speak Text and save to wav

16 posts in this topic

Hi,

Using ObjCreate("SAPI.SpVoice"), is it possible to speak the text and save it to a wav file ?

Thank you

Tuk

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

MsgBox(0, "Removed:", "See below.")

Thnk :):P

Edited by aceloc

[quote name='AceLoc']I gots new sunglasses there cool.[/quote]

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

_Talk()

@aceloc What are you trying to accomplish with that code? :) It's better to not make a post if you don't understand the topic rather than give people wrong information IMHO.

Edited by SolidSnake

HKTunes:Softpedia | GoogleCodeLyricToy:Softpedia | GoogleCodeRCTunes:Softpedia | GoogleCodeMichtaToolsProgrammer n. - An ingenious device that turns caffeine into code.

Share this post


Link to post
Share on other sites

I can talk the text but how will I save it to WAV ?

Thank you

Tuk

Share this post


Link to post
Share on other sites

Anybody ?

Share this post


Link to post
Share on other sites

Maybe you can use this.... Ultra Hal TTS Reader


Agreement is not necessary - thinking for one's self is!

My-Colors.jpg

cuniform2.gif

Share this post


Link to post
Share on other sites

Please guys, I use Autoit with ObjCreate("SAPI.SpVoice") to speak a text. All I want to do is save the spoken text as WAV file with Autoit alone.

Thank you

Tuk

Share this post


Link to post
Share on other sites

@tuk... AFAIK it hasn't been done with Autoit....yet

@fosil.... 1000% on the Avitar

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

Thanks. As I understand this will be possible only if someone will make a DLL for autoit.

So I will wait and hope to be lucky.

Thank you

Tuk

Edited by Tukata

Share this post


Link to post
Share on other sites

not sure if it will be a dll... but, i would love to have that capability in autoit also

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

Try this:

$strFName = @scriptdir&"\AudioOutputStream.wav"
$Text = "The TTS voice will speak this text into a file."
Const $SSFMCreateForWrite = 3

$objVOICE = ObjCreate("SAPI.SpVoice")
$objFSTRM = ObjCreate("SAPI.SpFileStream")

$objFSTRM.Open($strFName , $SSFMCreateForWrite, False)
$objVOICE.AudioOutputStream = $objFSTRM
$objVOICE.Speak($Text)
$objFSTRM.Close


[font="Fixedsys"][list][*]All of my AutoIt Example Scripts[*]http://saneasylum.com[/list][/font]

Share this post


Link to post
Share on other sites

#12 ·  Posted (edited)

lod3n

You are great !!!

Just when I was giving up, you came to the rescue.

Many many many thanks to you !

BTW, where can I find info about "SAPI.SpFileStream" command ?

Are there any parameters we can add to manipulate the recording ?

Can it be save to MP3 ? (just curious).

Does it works with all OS ?

Are there any limitation on the length of file or size or special characters like < " > ?

Thank you again

Tuk

Edited by Tukata

Share this post


Link to post
Share on other sites

I found this information on MSDN by searching for SAPI and .wav, and then I just translated it to AutoIt. I am sure there are more parameters, yes.

No, it cannot be saved to MP3 (that I know of), but you could run the resulting wav through a MP3 encoder afterwards.

This should work on any version of Windows where SAPI is installed. SAPI is available as a download from Microsoft if not, but it comes with Windows XP.

I haven't experimented with the text or file sizes, but I don't think there's a limit on either, other than physical disk space. I am going to post this as a UDF in Scripts and Scraps later, along with a method of saving it as a MP3. I will post a link to it here when I do.


[font="Fixedsys"][list][*]All of my AutoIt Example Scripts[*]http://saneasylum.com[/list][/font]

Share this post


Link to post
Share on other sites

#14 ·  Posted (edited)

lod3n

Thanks for the info.

I am using MMB (MultiMedia Builder) to send the $text as parameter and I know already that the < " > is a problem and should be removed from string.

I am sure many will like this UDF (me for sure).

I thouth about some features:

Speak and save.

Speak only.

Save only.

Convert to MP3

Recording with mic (?)

Capturing playing sound (from another application) !!!!

Good luck and thanks

Tuk

Edited by Tukata

Share this post


Link to post
Share on other sites

#16 ·  Posted (edited)

Well, I will be the first to let you all know that it works wonderfully on Windows® Longhorn® (otherwise know as Vista®). I know I will be able to put this UDF to good use sometime in the near or distant future. Thanks lod3n for the nice UDF contribution.

terrabyte

*EDIT:*

By the way, I will be putting this UDF under some testing. ie: File limitations, file formats, ect.

Edited by terrabyte

"...Yes, I am a criminal. My crime is that of curiosity. My crime is that of judging people by what they say and think, not what they look like.My crime is that of outsmarting you, something that you will never forgive me for." --The Mentor"Mess with the best, die like the rest!!" -Hackers"This above all to thine own self be true." -William Shakespeare"Corruption is only as corrupted as the individual makes it out to be." -Mozart_ONLINECheck out this free 1 GB FTP website at DriveHQ.com. You can control the users and even publish a website for free!![s]Your-Start.com - A online website that you can customize to hold all you links, news information, and other website info.[/s]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0