Jump to content
Sign in to follow this  

TTS script using google Translator

Recommended Posts


Hey Guys

For a Project of mine I want the nice lady from google translator to read out short text passages for me (just a few words). For a previous project I used this UDF. Now google has changed some things and it's not working anymore. So I googled for a solution and got it sort of running again. The problem I have though is, it only works when I run it the first time. After that it is just mute. When I type in the link manually however it still works. Can anyone help me?

Func _Say($parText,$parLanguage)
        $UDF_SPEAK_baseurl = "https://translate.google.com/translate_tts?ie=UTF-8&q="&_INetExplorerCapable($parText)&"&tl="&$parLanguage&"-TW&client=tw-obt"
        $UDF_SPEAK_filename = "txt2spch.mp3"
        FileDelete( @TempDir & "\" & $UDF_SPEAK_filename)
        InetGet( $UDF_SPEAK_baseurl, @TempDir & "\" & $UDF_SPEAK_filename, 1 )
        If @error Then
            SoundPlay("something") ;tmp replace "something" with error sound
            $UDF_SPEAK_file = @TempDir & "\" & $UDF_SPEAK_filename
            $UDF_SPEAK_sound = _SoundOpen( $UDF_SPEAK_file )
            _SoundPlay($UDF_SPEAK_sound, 1)


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  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.