TTS to file??

External libraries (GTK, GSL, SDL, Allegro, OpenGL, etc) questions.
albert
Posts: 5311
Joined: Sep 28, 2006 2:41
Location: California, USA

TTS to file??

Postby albert » Dec 03, 2011 6:14

How do you take windows Text_To_Speech and output it to a *.WAV file??

I cut and pasted the below code from the projects page.
Under the ASMIMOV1 AI_bot thingy.
I just want to make my own windows wav files to associate with actions under the personalize (sounds).

Code: Select all

#define UNICODE
#include once "/gd/disphelper/disphelper.bi"
#include once "windows.bi"
declare Sub speak (Byref text As String)

dim shared as string file
dim shared as string directory
   
directory = curdir + "\" + date + "_HR_" + left(time,2)
mkdir directory
file = directory + "\" + date + ".wav"
   
print "dir  = " ; directory
print
print "file = " ; file
   
speak "Hello!                                        "
Speak "How do you put this speech into a dot WAV file?"
     
sleep

'===============================================================================
'===============================================================================
'===============================================================================
'===============================================================================
Sub speak (Byref text As String)
    Dim myt As Wstring * 512
    Dim As Integer isSpeaking
    Dim As HRESULT hr
 
    DISPATCH_OBJ(tts)
 
    dhInitialize(TRUE)
    dhToggleExceptions(FALSE) 'set this TRUE to get error codes
 
    myt = "Sapi.SpVoice"
    hr = dhCreateObject(@myt, NULL, @tts)
    If hr <> 0 Then Exit Sub
 
    myt = text
    dhCallMethod(tts, ".Speak(%S)", @myt)
   
    SAFE_RELEASE(tts)
End Sub

TESLACOIL
Posts: 1769
Joined: Jun 20, 2010 16:04
Location: UK
Contact:

Postby TESLACOIL » Dec 05, 2011 20:47

TextToWav.exe is a freebie app which you can use to create and SAVE tts voices

you select the sapi 4 or sapi 5 voice (lots of free ones to dload )

adjust the speed pitch volume

just type in the text and save as *.wav *.mp3 etc

this is fine if you only need a few dozen sounds or a few 100 sounds



you could use sndrec32.exe windows or ' audacity' freeware to capture the audio stream going to your speakers


not sure if this is any help , sometimes going manually is the path of least resistance





there is some code on this forum to capture/ record an audio stream ,using double buffers etc etc
albert
Posts: 5311
Joined: Sep 28, 2006 2:41
Location: California, USA

Postby albert » Dec 06, 2011 1:09

Thank TESLACOIL !!! I got the TextToWav.exe
SevenLegion
Posts: 14
Joined: Dec 30, 2011 13:26

Re: TTS to file??

Postby SevenLegion » Dec 30, 2011 13:29

Please, give a link to "texttowav.exe"
cant find the right on and lots of sites tell it's a virus... (?)
SevenLegion
Posts: 14
Joined: Dec 30, 2011 13:26

Re: TTS to file??

Postby SevenLegion » Dec 30, 2011 17:43

Another question: I have a voice installed in windows as standar SAPI voice.
I need to automatically read a text file and create many small wav files.
To be more precise, every time there is special marker in the text, I need to create a new Wav file.
For example:

[->hello.wav]Hello word [->this.wav] this is an example of TTS [->made.wav] made for you

will create 3 wave files: hello.wav, this.wav and made.wav

So the task is parse the text file and to "drive" the SAPI voice and make produce my files.
The parsing is not a problem for me, but how to drive SAPI voice with free basic?
glove
Posts: 1
Joined: Feb 06, 2014 23:19

Re: TTS to file??

Postby glove » Feb 07, 2014 0:01

What's up with the #40; and the #41; being inserted in this code. It makes the code unusable. What's going on?
sir_mud
Posts: 1401
Joined: Jul 29, 2006 3:00
Location: US
Contact:

Re: TTS to file??

Postby sir_mud » Feb 08, 2014 16:30

glove wrote:What's up with the #40; and the #41; being inserted in this code. It makes the code unusable. What's going on?

&#40; = left parentheses, &#41; = right parentheses, the issue is being sorted out.
albert
Posts: 5311
Joined: Sep 28, 2006 2:41
Location: California, USA

Re: TTS to file??

Postby albert » Feb 08, 2014 17:28

I got the Text to Wave program here..

http://smart-butler.com/


Since i upgraded to FB .90 the code at top doesn't run can't find disphelper.bi
TESLACOIL
Posts: 1769
Joined: Jun 20, 2010 16:04
Location: UK
Contact:

Re: TTS to file??

Postby TESLACOIL » Mar 29, 2014 1:25

Something i looked into a while back.


CMU Sphinx. Open Source Toolkit For Speech Recognition.
http://cmusphinx.sourceforge.net/

I solved most of my speech related code stuff a while back, it was scrappy but worked. Im bogged down again in the vision stuff at the moment so i cant help directly ref speech stuff. Also check out Kiyote wolfs posts. We did start working on the speech thing together but we got kinda distracted and our efforts tailed off.

There is a LOT of useful speech related stuff on the FB forums, might be an idea for someone to gather it all up and make it tidy and accessible...>> thats me passing the buck :-p




There is some Vocaloid freeware out there that i had good fun with. Sort of Midi meets Sapi, might be worth investigating.
http://en.wikipedia.org/wiki/Vocaloid



Win 7 comes with some fairly good speech recognition stuff built in but alas you have to do a tedious registry hack in order to disable default voice commands...if that was not the case it would probably be worth buying win 7just for the speech capabilities alone...shoots M$ !with the biggest gun i can find !

Nuance has gone down the bloatware route, overpriced and difficult to integrate into hobby code.

Free TTS voices There are a good dozen or so free voices out there, the quality varies but there are some good ones that can be made much better if you can apply a little EQ / SFX

my 2 cents

Return to “Libraries”

Who is online

Users browsing this forum: No registered users and 2 guests