2 posts in this topic
This small UDF helps you save any text to speech to a .wav file.
#AutoIt3Wrapper_Au3Check_Parameters=-q -d -w 1 -w 2 -w 3 -w- 4 -w 5 -w 6 -w- 7 #include-once ; #INDEX# ======================================================================================================================= ; Title .........: _TTStoWav() ; AutoIt Version : 188.8.131.52 ; Language ......: English ; Author(s) .....: natedog102 ; Modifiers .....: ; Forum link ....: https://www.autoitscript.com/forum/topic/191573-tts-text-to-speech-to-wav-file-using-sapi/ ; Description ...: TTS to .wav file using SAPI ; =============================================================================================================================== ; #FUNCTION# ==================================================================================================================== ; Name...........: _TTStoWav ; Description ...: TTS to .wav file using SAPI ; Syntax.........: _TTStoWav($sText, $sLocation[, $iRate = 1[, $iVolume = 100]]) ; Parameters ....: $sText - String you want converted to a .wav ; $sLocation - Save location + file name, example: "C:\folder\sample.wav" ; $iRate - TTS speak rate between -10 and 10 ; $iVolume - Volume of the TTS between 0 and 100 ; Return values .: Success - Returns one ; Failure - Returns zero ; Author ........: natedog102 ; Modified.......: ; Remarks .......: ; Related .......: ; Link ..........: ; Example .......: No ; =============================================================================================================================== Func _TTStoWav($sText, $sLocation, $iRate = 1, $iVolume = 100) $oFileStream = ObjCreate("SAPI.SpFileStream") If @error Then Return 0 EndIf $oFileStream.Format.Type = 39 $oFileStream.Open($sLocation, 3) $oSpeech = ObjCreate('SAPI.SpVoice') If @error Then Return 0 EndIf $oSpeech.AudioOutputStream = $oFileStream $oSpeech.Rate = $iRate $oSpeech.Volume = $iVolume $oSpeech.Speak($sText, 3) $oSpeech.WaitUntilDone(10000) $oFileStream.Close() Return 1 EndFunc ;==>_TTStoWav And here's example usage:
_TTStoWav("This is a test", "C:\folder-must-exist\sample2.wav") I have never made a UDF before so I don't know if I coded it correctly or if I followed all the recommended guidelines. Apologies if I haven't.
Hello Guys this is my gui and i need the numeric value typed in the highlighted inputbox. if this value is greater than 1 i need to perform some operations
Here is the summary about that field which i got from wininfo tool
i tried writing the code as shown below.. but the msgbox is popping up empty value..when the same code is pasted under some button action i am able to access the value present in the field..but when placed alone as written in the attached script i am unable to fetch it...
here i am using the valu present in the field
can you guys tell me what's wrong??? or how can i get that value?
in need the path/text present int above shown input box to be copied or retrieved into a variable .. how can i do that?
Hello Friends i am new to autoit and i am stuck in middle of automation of flashing tool..
my requirement is i have a window and i have to get the value present in that window (below is the picture)
in the above window i need to get the value of the highlighted field.the value of this filed keeps on changing...ii need to get the current value present in the field..below are the details of the window and field..
CAN it be done?
I need a little bit help from some RegEx experts please:
I would make my ISN AutoIt Studio faster when generating the scripttree. And what would be better to do this via regex?
Problem is i am not really good at this regex stuff. So maybe someone could help me here.
The challange is to get all Global Variables from a script via RegEx in a Array.
Here is a example script with some tests:
Global $Var1 = 1234 Local $Local_Var = 1234 $Ignore_me_too = 1234 Global $Var2 = 1234, $var3 = 1242 Global $ahIcons, $ahLabels Global Const $Var4 = iniread($inivar1,"jj","jj","") , $var5= iniread($inivar2,"jj","jj","") Global $Var_String = "was" Global $Array_Test = [1,15,16,0,31,15,25,15,25,30,8,30,8,15,1,15] Global Enum $MARGIN_SCRIPT_NUMBER = 0, $MARGIN_SCRIPT_ICON, $MARGIN_SCRIPT_FOLD Global Const $Delim = '\', $Delim1 = '|' Global $hard1 = "a", _ $hard2 = "b", _ $hard3 = "c"
The returning array should look like this:
$Var1 $Var2 $var3 $Var4 $var5 $Var_String $Array_Test $MARGIN_SCRIPT_NUMBER $MARGIN_SCRIPT_ICON $MARGIN_SCRIPT_FOLD $Delim $Delim1 $hard1 $hard2 $hard3
I already made some success with a expression i found in the SciTE Jump Tool: (\$\w+)(?:[\h\[.=+*/^,)\-])?
This nearly returns the perfect results. But it does not check if it´s a global variable (with the const and enum options) and also returns variables in commands (for example $inivar1)
I also found this regex: (?im:^(?=Global|Const|Enum|Static)(?:Global)?\h*(?:Const|Enum|Static)?(?:(?<=Enum)\h+Step\h+[+*-]\d+)?\h*)([^\r\n .\=]+)
This returns also usefull results...but trying to understand this explodes my head
Maybe someone can help me here?
Thanks in advance!