Snippets ( AutoIt Audio ): Difference between revisions
Jump to navigation
Jump to search
m (+Snippets Category (+ normalize top)) |
m (Edited snippets to conform to template snippet header) |
||
Line 4: | Line 4: | ||
{{Snippet Credit Header}} | {{Snippet Credit Header}} | ||
{{Snippet Header | == _EnableBeepSpeaker == | ||
{{Snippet Header | |||
|AuthorURL=20477-mrcreator | |||
|AuthorName=MrCreatoR | |||
}} | |||
<syntaxhighlight lang = "autoit"> | |||
; Stop internal "beep" speaker | ; Stop internal "beep" speaker | ||
Line 22: | Line 29: | ||
Sleep($iPause) | Sleep($iPause) | ||
EndFunc | EndFunc | ||
</syntaxhighlight> | |||
[[#top | ReturnToContents]] | |||
== _IEclickSound == | |||
{{Snippet Header | |||
| AuthorURL=52303-djarlo | |||
| AuthorName=Djarlo | |||
}} | }} | ||
<syntaxhighlight lang = "autoit"> | |||
$click = _IEclickSound() ;<= off | $click = _IEclickSound() ;<= off | ||
_IEclickSound($click);<== restore original state | _IEclickSound($click);<== restore original state | ||
Func _IEclickSound($sound = "") | Func _IEclickSound($sound = "") | ||
Line 38: | Line 53: | ||
Return $rc | Return $rc | ||
EndFunc ;==>_IEclickSound | EndFunc ;==>_IEclickSound | ||
</syntaxhighlight> | |||
[[#top | ReturnToContents]] | |||
== _TalkOBJ == | |||
{{Snippet Header | |||
| AuthorURL=3581-erifash | |||
| AuthorName=erifash | |||
}} | }} | ||
<syntaxhighlight lang = "autoit"> | |||
; Voice Read Text | ; Voice Read Text | ||
Line 51: | Line 75: | ||
$o_speech = "" | $o_speech = "" | ||
EndFunc ;==>_TalkOBJ() | EndFunc ;==>_TalkOBJ() | ||
</syntaxhighlight> | |||
[[#top | ReturnToContents]] |
Latest revision as of 19:27, 13 November 2012
_EnableBeepSpeaker
Author: MrCreatoR
; Stop internal "beep" speaker
_EnableBeepSpeaker(0)
Beep(200, 600)
_EnableBeepSpeaker(1)
Beep(500, 300)
Func _EnableBeepSpeaker($iFlag=0, $iPause=500)
Switch $iFlag
Case 0
Run(@ComSpec & ' /c net stop beep & sc config beep start= disabled', '', @SW_HIDE)
Case Else
Run(@ComSpec & ' /c sc config beep start= system & net start beep', '', @SW_HIDE)
EndSwitch
Sleep($iPause)
EndFunc
_IEclickSound
Author: Djarlo
$click = _IEclickSound() ;<= off
_IEclickSound($click);<== restore original state
Func _IEclickSound($sound = "")
If $sound <> "" Then
If Not FileExists($sound) Then Return SetError(1, 0, 0)
EndIf
Local $rc = RegRead("HKEY_CURRENT_USER\AppEvents\Schemes\Apps\Explorer\Navigating\.Current", "")
If @error Then Return SetError(2, 0, 0)
RegWrite("HKEY_CURRENT_USER\AppEvents\Schemes\Apps\Explorer\Navigating\.Current", "", "REG_EXPAND_SZ", $sound)
Return $rc
EndFunc ;==>_IEclickSound
_TalkOBJ
Author: erifash
; Voice Read Text
_TalkOBJ("Speak this line of text Please") ; change the text to suit
Func _TalkOBJ($s_text)
Local $o_speech
$o_speech = ObjCreate("SAPI.SpVoice")
$o_speech.Speak ($s_text)
$o_speech = ""
EndFunc ;==>_TalkOBJ()