Snippets ( AutoIt Audio ): Difference between revisions

From AutoIt Wiki
Jump to navigation Jump to search
No edit summary
 
m (Edited snippets to conform to template snippet header)
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
__TOC__
__TOC__
<div class="center" style="width:auto; margin-left:auto; margin-right:auto;">'''Please always credit an author in your script if you use their code, Its only polite.'''</div>
[[category:Snippets]]
===== <blockquote style="background-color:white; padding:1em; border:2px solid #8FBC8F">''' _EnableBeepSpeaker() ~ Author - [http://www.autoitscript.com/forum/user/20477-mrcreator/ MrCreatoR] '''</blockquote> =====
 
<syntaxhighlight lang="autoit">
{{Snippet Credit Header}}
 
== _EnableBeepSpeaker ==
 
{{Snippet Header
|AuthorURL=20477-mrcreator
|AuthorName=MrCreatoR
}}
 
<syntaxhighlight lang = "autoit">
; Stop internal "beep" speaker
; Stop internal "beep" speaker


Line 22: Line 31:
</syntaxhighlight>
</syntaxhighlight>


===== <blockquote style="background-color:white; padding:1em; border:2px solid #8FBC8F">''' _IEclickSound() ~ Author - [http://www.autoitscript.com/forum/user/52303-djarlo/ Djarlo] '''</blockquote> =====
[[#top | ReturnToContents]]
 
== _IEclickSound ==
 
{{Snippet Header
| AuthorURL=52303-djarlo
| AuthorName=Djarlo
}}


<syntaxhighlight lang="autoit">  
<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 40: Line 55:
</syntaxhighlight>
</syntaxhighlight>


===== <blockquote style="background-color:white; padding:1em; border:2px solid #8FBC8F">''' _TalkOBJ() ~ Author - [http://www.autoitscript.com/forum/user/3581-erifash/ erifash] '''</blockquote> =====
[[#top | ReturnToContents]]


<syntaxhighlight lang="autoit">
== _TalkOBJ ==
 
{{Snippet Header
| AuthorURL=3581-erifash
| AuthorName=erifash
}}
 
<syntaxhighlight lang = "autoit">
; Voice Read Text
; Voice Read Text


Line 54: Line 76:
EndFunc ;==>_TalkOBJ()
EndFunc ;==>_TalkOBJ()
</syntaxhighlight>
</syntaxhighlight>
[[#top | ReturnToContents]]

Latest revision as of 19:27, 13 November 2012


Please always credit an author in your script if you use their code. It is only polite.


_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

ReturnToContents

_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

ReturnToContents

_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()

ReturnToContents