#include <IE.au3> ;<a href='http://www.research.att.com/~ttsweb/tts/demo.php' class='bbc_url' title='External link' rel='nofollow external'>http://www.research.att.com/~ttsweb/tts/demo.php</a> $data_voice = "mike"; Or crystal $data_txt = InputBox( "TTS", "Enter Text", "hello there" ) $ie = _IECreate( "<a href='http://www.research.att.com/~ttsweb/tts/demo.php' class='bbc_url' title='External link' rel='nofollow external'>http://www.research.att.com/~ttsweb/tts/demo.php"</a>, 0, 0 ) $form = _IEFormGetObjByName( $ie, "demoForm" ) $voice = _IEFormElementGetObjByName( $form, "voice" ) _IEFormElementSetValue( $voice, $data_voice ) $txt = _IEFormElementGetObjByName( $form, "txt" ) _IEFormElementSetValue( $txt, $data_txt ) $submit = _IEFormElementGetObjByName( $form, "downloadButton" ) $submit.click _IELoadWait( $ie ) $read = _IEBodyReadText( $ie ) _IEQuit( $ie ) $start = "Your audio can be found at " $end = "To download, right-click the link above." $url = extractString( $read, $start, $end ) $url = "<a href='http://192.20.225.55' class='bbc_url' title='External link' rel='nofollow external'>http://192.20.225.55"</a> & $url ConsoleWrite( $url ) InetGet( $url, @TempDir & "\tts.wav", 1 ) SoundPlay( @TempDir & "\tts.wav", 1 ) Func extractString($string, $startString, $endString) ;this function returns the contents of a string between two substrings $startStringPos = StringInStr($string, $startString) $endStringPos = StringInStr($string, $endString) $startPos = $startStringPos + StringLen($startString) - 1 $endPos = $endStringPos - 1 $extractedString = StringLeft($string, $endPos) $extractedString = StringTrimLeft($extractedString, $startPos) Return $extractedString EndFunc ;==>extractString
Edited by zerocool60544, 22 October 2006 - 07:13 AM.





