Sign in to follow this  
Followers 0
Prab

Text to speech

5 posts in this topic

#1 ·  Posted (edited)

Found via techcrunch.

Just a quick hack using an unofficial api. I could make it more pretty. It just doesn't play anything if you give it a string over 100 characters.

textToSpeach("google is the best")

Func textToSpeach($input)
    $temp = StringReplace($input, " ", "+")
    InetGet("http://translate.google.com/translate_tts?q=" & $temp, @TempDir & "\test.mp3")
    SoundPlay(@TempDir & "\test.mp3", 1)
    FileDelete(@TempDir & "\test.mp3")
EndFunc

Edit: Tested with over 100 characters

Edited by Prab

Share this post


Link to post
Share on other sites



hehe, cool voice :-) i'll hope there would be other languages as well in future :-)

Share this post


Link to post
Share on other sites

Don't listen to Horrendous.

textToSpeach(BinaryToString("0x6675636B2074686973207368697420697320636F6F6C2E204E69636520766F6963652E"))

Func textToSpeach($input)
    $temp = StringReplace($input, " ", "+")
    InetGet("http://translate.google.com/translate_tts?q=" & $temp, @TempDir & "\test.mp3")
    SoundPlay(@TempDir & "\test.mp3", 1)
    FileDelete(@TempDir & "\test.mp3")
EndFunc

♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Hi

I have tried both of the above scripts from Scite and get the following error

ERROR: Returning Failure - FileName - ..\..\src\EzdMP3SourceOutputPin.cpp Line - 370

It still plays

also noticed i don't hear the first few letters/words when i play it from my work machine. it is a high end machine, so i don't think it is a speed issue.

I have tried

textToSpeach(".....I am the master and i am in charge")

and only hear "master and i am in charge"

and also

textToSpeach("I am the master and i am in charge")

same result

Edited by happy2help

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

@happy2help - Don't know about the first error. As you can see, my code is only about 5 lines long so it must be something else that is crashing. For your second problem try getting rid of

FileDelete(@TempDir & "\test.mp3")
then find the file in your temp dir and play it in Itunes/Windows Media Player/VLC. If the mp3 doesn't have all the letters, its a problem with google translate, if it does, its a problem with soundplay().

Edited by Prab

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