Hi wie regelt man eigendlich die lautstärke?
Also beim slider bin ich schon angekommen
bitte um hilfe
Lautstärke
-
- [ offen ]
-
Detroit49 -
22. Februar 2010 um 17:48 -
Geschlossen -
Erledigt
-
-
[autoit]
SoundSetWaveVolume
[/autoit]Oder welche Lautstärke meinst du?
-
Ich meine die sytemlautstäke
z.b musik lauter und leiser machen und das mit dem Koda Regler
-
dann ist soundsetwavevolume das richtige
-
ok danke
Edit :
irgendwie geht das nicht
[autoit]#include <GUIConstantsEx.au3>
[/autoit][autoit][/autoit][autoit]
#include <SliderConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>#Region ### START Koda GUI section ### Form=c:\users\detroit49\desktop\lautstärke.kxf
[/autoit][autoit][/autoit][autoit]
$Form1_1 = GUICreate("Lautstärke", 196, 78, 192, 124)
$Group1 = GUICtrlCreateGroup("", 0, 0, 193, 73)
$Slider1 = GUICtrlCreateSlider(16, 16, 150, 45)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###While 1
[/autoit]
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
case $Slider1
_wavelaut ()
EndSwitch
WEnd
Func _wavelaut()
SoundSetWaveVolume(50)
EndFunc -
System Windows 7
-
oh du hast auch win 7. da geht das leider nichtmehr.
aus der hilfe:
ZitatFunktion SoundSetWaveVolumeIn Windows Vista gibt es keine systemweite Wave-Lautstärke. Diese Funktion ändert nur die Wave-Lautstärke für das Skript. Es kann nicht verwendet werden, um die Lautstärke für andere Programme zu ändern.
gleiches gilt für win7.
es wird also nur die wavelautstärke deines scriptes verändertedit:
evtl hilft das weiter. hab aber damit auch noch nicht gearbeitet
[ offen ] Vista Sound Wert -
habe mir grade die audio.au3 geladen aber damit komme ich nicht so wirklich klar
und mit hilfe dieser soll es ja auch bei vista und co. gehenGib es den die möglichkeine Die Hauseigene steuerung zu öffnen ?
[autoit]#cs
[/autoit][autoit][/autoit][autoit][/autoit][autoit]
Audio.au3
Designed by Gary Frost, RazerM, Xenobiologist, and a little help from Volly
Version info: 1.0.0.1
History:
1.0.0.1 - Ismute function added - thanks Xenobiologist-------------------------------------------
[/autoit][autoit][/autoit][autoit]
Items to add:
1. Mute for master volume.
2. Mute for input Microphone
3. Mute for Wave
4. Balance on Master, Wave, Microphone
-------------------------------------------
The following code is a proposed replacement for sound.au3. Current functions work
as expected following testing on XP pc. No test have been performed on other operating systems.
-------------------------------------------Functions:
[/autoit][autoit][/autoit][autoit]
_SoundOpen ( $hFile [, $sAlias ] ) - Opens a sound file for use with other _Sound functions.
_SoundClose($sSnd_id) - Closes a sound previously opened with _SoundOpen.
_SoundPlay ( $sSnd_id [, $fWait ] ) - Play a sound file.
_SoundStop ( $sSnd_id ) - Stop a playing sound.
_SoundPause($sSnd_id) - Pause a playing sound.
_SoundResume ( $sSnd_id ) - Resume a paused sound.
_SoundLength ( $sSnd_id [, $iMode ] ) - Returns the length of the soundfile.
_SoundSeek ( $sSnd_id, $iHour, $iMin, $iSec ) - Seeks the sound to the specified position
_SoundStatus ( $sSnd_id ) - Returns the status of the sound
_SoundPos ( $sSnd_id [, $iMode ] ) - Returns the current position of the sound.
_SoundSetMasterVolume($iVolume) - Sets the Master Volume. Does not control an application's volume
_SoundGetMasterVolume - Gets the Master Volume level
_SoundSetMicrophoneVolume - Sets the Microphone input volume
_SoundGetMicrophoneVolume - Gets the Microphone volume level
_SoundGetPhoneVolume - Gets the Phone volume on the modem
_SoundSetVolumeCD - Sets the Volume level on the CDRom
_SoundSetMasterWaveVolume - Sets the Master Wave Volume level
_Ismute - Checks for mute sound
#ce#region
[/autoit][autoit][/autoit][autoit]
Const $MMSYSERR_NOERROR = 0
Const $WAVERR_BASE = 32
Const $WAVERR_BADFORMAT = ($WAVERR_BASE + 0)
Const $MAXPNAMELEN = 32Const $MIXERLINE_COMPONENTTYPE_DST_FIRST = 0
[/autoit][autoit][/autoit][autoit]
Const $MIXER_GETLINEINFOF_COMPONENTTYPE = 3
Const $MIXERLINE_COMPONENTTYPE_DST_UNDEFINED = ($MIXERLINE_COMPONENTTYPE_DST_FIRST + 0)
Const $MIXERLINE_COMPONENTTYPE_DST_DIGITAL = ($MIXERLINE_COMPONENTTYPE_DST_FIRST + 1)
Const $MIXERLINE_COMPONENTTYPE_DST_LINE = ($MIXERLINE_COMPONENTTYPE_DST_FIRST + 2)
Const $MIXERLINE_COMPONENTTYPE_DST_MONITOR = ($MIXERLINE_COMPONENTTYPE_DST_FIRST + 3)
Const $MIXERLINE_COMPONENTTYPE_DST_SPEAKERS= ($MIXERLINE_COMPONENTTYPE_DST_FIRST + 4)
Const $MIXERLINE_COMPONENTTYPE_DST_HEADPHONES = ($MIXERLINE_COMPONENTTYPE_DST_FIRST + 5)
Const $MIXERLINE_COMPONENTTYPE_DST_TELEPHONE = ($MIXERLINE_COMPONENTTYPE_DST_FIRST + 6)
Const $MIXERLINE_COMPONENTTYPE_DST_WAVEIN = ($MIXERLINE_COMPONENTTYPE_DST_FIRST + 7)
Const $MIXERLINE_COMPONENTTYPE_DST_VOICEIN = ($MIXERLINE_COMPONENTTYPE_DST_FIRST +
Const $MIXERLINE_COMPONENTTYPE_DST_LAST = ($MIXERLINE_COMPONENTTYPE_DST_FIRST +Const $MIXERLINE_COMPONENTTYPE_SRC_FIRST = 0x1000
[/autoit][autoit][/autoit][autoit]
Const $MIXERLINE_COMPONENTTYPE_SRC_UNDEFINED = ($MIXERLINE_COMPONENTTYPE_SRC_FIRST + 0)
Const $MIXERLINE_COMPONENTTYPE_SRC_DIGITAL = ($MIXERLINE_COMPONENTTYPE_SRC_FIRST + 1)
Const $MIXERLINE_COMPONENTTYPE_SRC_LINE = ($MIXERLINE_COMPONENTTYPE_SRC_FIRST + 2)
Const $MIXERLINE_COMPONENTTYPE_SRC_MICROPHONE= ($MIXERLINE_COMPONENTTYPE_SRC_FIRST + 3)
Const $MIXERLINE_COMPONENTTYPE_SRC_SYNTHESIZER = ($MIXERLINE_COMPONENTTYPE_SRC_FIRST + 4)
Const $MIXERLINE_COMPONENTTYPE_SRC_COMPACTDISC = ($MIXERLINE_COMPONENTTYPE_SRC_FIRST + 5)
Const $MIXERLINE_COMPONENTTYPE_SRC_TELEPHONE = ($MIXERLINE_COMPONENTTYPE_SRC_FIRST + 6)
Const $MIXERLINE_COMPONENTTYPE_SRC_PCSPEAKER = ($MIXERLINE_COMPONENTTYPE_SRC_FIRST + 7)
Const $MIXERLINE_COMPONENTTYPE_SRC_WAVEOUT = ($MIXERLINE_COMPONENTTYPE_SRC_FIRST +
Const $MIXERLINE_COMPONENTTYPE_SRC_AUXILIARY = ($MIXERLINE_COMPONENTTYPE_SRC_FIRST + 9)
Const $MIXERLINE_COMPONENTTYPE_SRC_ANALOG = ($MIXERLINE_COMPONENTTYPE_SRC_FIRST + 10)
Const $MIXERLINE_COMPONENTTYPE_SRC_LAST = ($MIXERLINE_COMPONENTTYPE_SRC_FIRST + 10)Const $MIXER_GETLINEINFOF_SOURCE = 1
[/autoit][autoit][/autoit][autoit]Const $MIXER_GETLINEINFOF_DESTINATION = 0
[/autoit][autoit][/autoit][autoit]
Const $MIXER_GETLINEINFOF_LINEID = 2
Const $MIXERCONTROL_CT_SC_LIST_SINGLE = 0x00000000
Const $MIXERCONTROL_CT_CLASS_LIST = 0x70000000
Const $MIXERCONTROL_CT_SC_LIST_MULTIPLE = 0x01000000
Const $MIXERCONTROL_CT_UNITS_BOOLEAN = 0x00010000
Const $MIXERCONTROL_CT_CLASS_MASK = 0xF0000000
Const $MIXERCONTROL_CONTROLTYPE_MULTIPLESELECT = BitOR($MIXERCONTROL_CT_CLASS_LIST, $MIXERCONTROL_CT_SC_LIST_MULTIPLE, $MIXERCONTROL_CT_UNITS_BOOLEAN)
Const $MIXERCONTROL_CONTROLTYPE_MIXER = ($MIXERCONTROL_CONTROLTYPE_MULTIPLESELECT + 1)
Const $MIXERCONTROL_CONTROLTYPE_SINGLESELECT = BitOR($MIXERCONTROL_CT_CLASS_LIST, $MIXERCONTROL_CT_SC_LIST_SINGLE, $MIXERCONTROL_CT_UNITS_BOOLEAN)
Const $MIXERCONTROL_CONTROLTYPE_MUX = ($MIXERCONTROL_CONTROLTYPE_SINGLESELECT + 1)
Const $MIXER_GETCONTROLDETAILSF_VALUE = 0
Const $MIXER_SETCONTROLDETAILSF_VALUE = 0
Const $MIXERCONTROL_CONTROLF_UNIFORM = 1
Const $MIXERCONTROL_CONTROLF_MULTIPLE = 2Const $MIXERCONTROL_CT_SC_METER_POLLED = 0
[/autoit][autoit][/autoit][autoit]
Const $MIXERCONTROL_CT_CLASS_METER = 0x10000000
Const $MIXERCONTROL_CT_UNITS_SIGNED = 0x20000
Const $MIXERCONTROL_CT_UNITS_UNSIGNED = 0x30000
Const $MIXERCONTROL_CT_CLASS_FADER = 0x50000000
Const $MIXERCONTROL_CT_CLASS_NUMBER = 0x30000000
Const $MIXERCONTROL_CONTROLTYPE_FADER = BitOR($MIXERCONTROL_CT_CLASS_FADER, $MIXERCONTROL_CT_UNITS_UNSIGNED)
Const $MIXERCONTROL_CONTROLTYPE_VOLUME= ($MIXERCONTROL_CONTROLTYPE_FADER + 1)
Const $MIXERCONTROL_CONTROLTYPE_UNSIGNEDMETER = BitOR($MIXERCONTROL_CT_CLASS_METER, $MIXERCONTROL_CT_SC_METER_POLLED, $MIXERCONTROL_CT_UNITS_UNSIGNED)
Const $MIXERCONTROL_CONTROLTYPE_UNSIGNED = BitOR($MIXERCONTROL_CT_CLASS_NUMBER, $MIXERCONTROL_CT_UNITS_UNSIGNED)
Const $MIXERCONTROL_CONTROLTYPE_SIGNED = BitOR($MIXERCONTROL_CT_CLASS_NUMBER, $MIXERCONTROL_CT_UNITS_SIGNED)Const $MIXER_OBJECTF_WAVEIN = 0x20000000
[/autoit][autoit][/autoit][autoit]
Const $MIXER_SHORT_NAME_CHARS = 16
Const $MIXER_LONG_NAME_CHARS = 64
Const $MIXER_GETLINECONTROLSF_ALL = 0
Const $MIXER_GETLINECONTROLSF_ONEBYID = 1
Const $MIXER_GETLINECONTROLSF_ONEBYTYPE = 2
Const $MIXER_OBJECTF_HANDLE = 0x80000000
Const $MIXER_OBJECTF_MIXER = 0
Const $MIXER_OBJECTF_HMIXER = BitOR($MIXER_OBJECTF_HANDLE, $MIXER_OBJECTF_MIXER)
Const $MIXER_GETCONTROLDETAILSF_LISTTEXT = 1
Const $CALLBACK_NULL = 0
Const $WAVE_MAPPED = 4Const $wMid = 1
[/autoit][autoit][/autoit][autoit]
Const $wPid = 2
Const $vDriverVersion = 3
Const $szPname = 4
Const $dwFormats = 5
Const $wChannels = 6
Const $wReserved1 = 7
Const $AWICAPS_SIZEOF = $wReserved1 + 1;mixer
[/autoit][autoit][/autoit][autoit]
Const $fdwSupport = 5
Const $cDestinations = 6
Const $AMXCAPS_SIZEOF = $cDestinations + 2 ;leave room for num cells;line struct
[/autoit][autoit][/autoit][autoit]
Const $cbStruct = 1
Const $dwDestination = 2
Const $dwSource = 3
Const $dwLineID = 4
Const $fdwLine = 5
Const $dwUser = 6
Const $dwComponentType = 7
Const $cChannels = 8
Const $cConnections = 9
Const $cControls = 10
Const $szShortName = 11
Const $szName = 12
Const $dwType = 13
Const $dwDeviceID = 14
Const $wMMid = 15
Const $wMPid = 16
Const $vMDriverVersion = 17
Const $szMPname = 18
$AMXLINE_SIZEOF = $szMPname + 2Const $cbCStruct = 1
[/autoit][autoit][/autoit][autoit]
Const $dwCLineID = 2
Const $dwControlID = 3
Const $dwControlType = 4
Const $cCControls = 5
Const $cbmxctrl = 6
Const $pamxctrl = 7
Const $MXXTRLS_SIZEOF = $pamxctrl + 2Const $lst_destname = 1
[/autoit][autoit][/autoit][autoit]
Const $lst_dwComponentType = 2
Const $lst_ctrid = 3Const $MIX_HMXOBJ = 1
[/autoit][autoit][/autoit][autoit][/autoit][autoit]
Const $MIX_DEVNAME = 2
Const $MIX_CAPCDEST = 3
Const $MIX_RECNAME = 4
Const $MIX_CCONNECTIONS = 5
Const $MIX_INCCONTROLS = 6
Const $MIX_DWLINEID = 7
Const $MIX_INCHANNELS = 8
Const $MIX_INMULTIITEMS = 9
Const $MIX_INCTRLID = 10
Const $MIX_OUTCHANNELS = 11
Const $MIX_OUTMULTIEMS = 12
Const $MIX_OUTCTRLID = 13
Const $MIX_LAST = $MIX_OUTCTRLID + 1
Const $AMIX_SIZEOF = $MIX_LAST + 1
Dim $mxline[$AMXLINE_SIZEOF]
Dim $mixers[1][$AMIX_SIZEOF]
Dim $mxInList[2][4]
$mixernames = ""
$FormSelectInput = 0
$TV_SelectInput = 0
$CMB_DevName = 0
$CKB_EnableLinefocus = 0
$defaultmixer = 0
$lastlinesrc = -1
$curmixer = $defaultmixer
;===============================================================================
#endregion;===============================================================================
[/autoit][autoit][/autoit][autoit]
;
; Function Name: _SoundOpen
; Description:: Opens a sound file for use with other _Sound functions
; Parameter(s): $hFile - The sound file, $sAlias[optianal] - a name such as sound1,
; if you do not specify one it is randomly generated
; Requirement(s): AutoIt 3.2 ++
; Return Value(s): string(the sound id) - Success, 0 - Failure
; @extended <> 0 - open failed, @error = 2 - File doesn't exist,
; @error = 3 - alias contains whitespace
; Author(s): RazerM
;
;===============================================================================
;
Func _SoundOpen($hFile, $sAlias = "")
;Declare variables
Local $sSnd_id, $iCurrentPos, $iRet, $asAlias
;check for file
If Not FileExists($hFile) Then Return SetError(2, 0, 0)
;search for whitespace by character
$asAlias = StringSplit($sAlias, "")
For $iCurrentPos = 1 To $asAlias[0]
If StringIsSpace($asAlias[$iCurrentPos]) Then Return SetError(3, 0, 0)
Next
;create random alias if one is not supplied
If $sAlias = "" Then
$sSnd_id = RandomStr(10)
Else
$sSnd_id = $sAlias
EndIf
;open file
$iRet = mciSendString("open " & FileGetShortName($hFile) & " alias " & FileGetShortName($sSnd_id))
Return SetError(0, $iRet, $sSnd_id)
EndFunc ;==>_SoundOpen;===============================================================================
[/autoit][autoit][/autoit][autoit]
;
; Function Name: _SoundClose
; Description:: Closes a sound
; Parameter(s): $sSnd_id - Sound ID returned by _SoundOpen
; Requirement(s): AutoIt 3.2 ++
; Return Value(s): 1 - Success, 0 and @error = 1 - Failure
; Author(s): RazerM
;
;===============================================================================
;
Func _SoundClose($sSnd_id)
If mciSendString("close " & FileGetShortName($sSnd_id)) = 0 Then
Return 1
Else
Return SetError(1, 0, 0)
EndIf
EndFunc ;==>_SoundClose;===============================================================================
[/autoit][autoit][/autoit][autoit]
;
; Function Name: _SoundPlay
; Description:: Plays a sound from the current position (beginning is the default)
; Parameter(s): $sSnd_id - Sound ID returned by _SoundOpen or sound file
; $fWait - If set to 1 the script will wait for the sound to finish before continuing
; - If set to 0 the script will continue while the sound is playing
; Requirement(s): AutoIt 3.2 ++
; Return Value(s): 1 - Success, 0 - Failure
; @error = 2 - $fWait is invalid, @error = 1 - play failed
; Author(s): RazerM
;
;===============================================================================
;
Func _SoundPlay($sSnd_id, $fWait = 0)
;Declare variables
Local $iRet
;validate $fWait
If $fWait <> 0 And $fWait <> 1 Then Return SetError(2, 0, 0)
;if sound has finished, seek to start
If _SoundPos($sSnd_id, 2) = _SoundLength($sSnd_id, 2) Then mciSendString("seek " & FileGetShortName($sSnd_id) & " to start")
;If $fWait = 1 then pass wait to mci
If $fWait = 1 Then
$iRet = mciSendString("play " & FileGetShortName($sSnd_id) & " wait")
Else
$iRet = mciSendString("play " & FileGetShortName($sSnd_id))
EndIf
;return
If $iRet = 0 Then
Return 1
Else
Return SetError(1, 0, 0)
EndIf
EndFunc ;==>_SoundPlay;===============================================================================
[/autoit][autoit][/autoit][autoit]
;
; Function Name: _SoundStop
; Description:: Stops the sound
; Parameter(s): $sSnd_id - Sound ID returned by _SoundOpen or sound file
; Requirement(s): AutoIt 3.2 ++
; Return Value(s): 1 - Success, 0 and @error = 1 - Failure,
; Author(s): RazerM
;
;===============================================================================
;
Func _SoundStop($sSnd_id)
;Declare variables
Local $iRet, $iRet2
;seek to start
$iRet = mciSendString("seek " & FileGetShortName($sSnd_id) & " to start")
;stop
$iRet2 = mciSendString("stop " & FileGetShortName($sSnd_id))
;return
If $iRet = 0 And $iRet2 = 0 Then
Return 1
Else
Return SetError(1, 0, 0)
EndIf
EndFunc ;==>_SoundStop;===============================================================================
[/autoit][autoit][/autoit][autoit]
;
; Function Name: _SoundPause
; Description:: Pauses the sound
; Parameter(s): $sSnd_id - Sound ID returned by _SoundOpen or sound file
; Requirement(s): AutoIt 3.2 ++
; Return Value(s): 1 - Success, 0 and @error = 1 - Failure,
; Author(s): RazerM
;
;===============================================================================
;
Func _SoundPause($sSnd_id)
;Declare variables
Local $iRet
;pause sound
$iRet = mciSendString("pause " & FileGetShortName($sSnd_id))
;return
If $iRet = 0 Then
Return 1
Else
Return SetError(1, 0, 0)
EndIf
EndFunc ;==>_SoundPause;===============================================================================
[/autoit][autoit][/autoit][autoit]
;
; Function Name: _SoundResume
; Description:: Resumes the sound after being paused
; Parameter(s): $sSnd_id - Sound ID returned by _SoundOpen or sound file
; Requirement(s): AutoIt 3.2 ++
; Return Value(s): 1 - Success, 0 and @error = 1 - Failure,
; Author(s): RazerM
;
;===============================================================================
;
Func _SoundResume($sSnd_id)
;Declare variables
Local $iRet
;resume sound
$iRet = mciSendString("resume " & FileGetShortName($sSnd_id))
;return
If $iRet = 0 Then
Return 1
Else
Return SetError(1, 0, 0)
EndIf
EndFunc ;==>_SoundResume;===============================================================================
[/autoit][autoit][/autoit][autoit]
;
; Function Name: _SoundLength
; Description:: Returns the length of the sound in the format hh:mm:ss
; Parameter(s): $sSnd_id - Sound ID returned by _SoundOpen or sound file,
; $iMode = 1 - hh:mm:ss, $iMode = 2 - milliseconds
; Requirement(s): AutoIt 3.2 ++
; Return Value(s): Length of the sound - Success, 0 and @error = 1 - $iMode is invalid
; Author(s): RazerM
;
;===============================================================================
;
Func _SoundLength($sSnd_id, $iMode = 1)
;Declare variables
Local $iSnd_len_ms, $iSnd_len_min, $iSnd_len_hour, $iSnd_len_sec, $sSnd_len_format
;validate $iMode
If $iMode <> 1 And $iMode <> 2 Then Return SetError(1, 0, 0)
;tell mci to use time in milliseconds
mciSendString("set " & FileGetShortName($sSnd_id) & " time format miliseconds")
;recieve length of sound
$iSnd_len_ms = mciSendString("status " & FileGetShortName($sSnd_id) & " length")
;assign modified data to variables
$iSnd_len_min = Int($iSnd_len_ms / 60000)
$iSnd_len_hour = Int($iSnd_len_min / 60)
$iSnd_len_sec = Int(Int($iSnd_len_ms / 1000) - ($iSnd_len_min * 60))
;assign formatted data to $sSnd_len_format
$sSnd_len_format = StringFormat("%02i:%02i:%02i", $iSnd_len_hour, $iSnd_len_min, $iSnd_len_sec)
;return correct variable
If $iMode = 1 Then Return $sSnd_len_format
If $iMode = 2 Then Return $iSnd_len_ms
EndFunc ;==>_SoundLength;===============================================================================
[/autoit][autoit][/autoit][autoit]
;
; Function Name: _SoundSeek
; Description:: Seeks the sound to a specified time
; Parameter(s): $sSnd_id - Sound ID returned by _SoundOpen (must NOT be a file), $iHour, $iMin, $iSec
; Requirement(s): AutoIt 3.2 ++
; Return Value(s): 1 - Success, 0 and @error = 1 - Failure,
; Author(s): RazerM
;
;===============================================================================
;
Func _SoundSeek($sSnd_id, $iHour, $iMin, $iSec)
;Declare variables
Local $iMs = 0
Local $iRet
;prepare mci to recieve time in milliseconds
mciSendString("set " & FileGetShortName($sSnd_id) & " time format miliseconds")
;modify the $iHour, $iMin and $iSec parameters to be in milliseconds
;and add to $iMs
$iMs += $iSec * 1000
$iMs += $iMin * 60 * 1000
$iMs += $iHour * 60 * 60 * 1000
; seek sound to time ($iMs)
$iRet = mciSendString("seek " & FileGetShortName($sSnd_id) & " to " & $iMs)
;return
If $iRet = 0 Then
Return 1
Else
Return SetError(1, 0, 0)
EndIf
EndFunc ;==>_SoundSeek;===============================================================================
[/autoit][autoit][/autoit][autoit]
;
; Function Name: _SoundStatus
; Description:: All devices can return the "not ready", "paused", "playing", and "stopped" values.
; Some devices can return the additional "open", "parked", "recording", and "seeking" values.(MSDN)
; Parameter(s): $sSnd_id - Sound ID returned by _SoundOpen or sound file
; Requirement(s): AutoIt 3.2 ++
; Return Value(s): Sound Status
; Author(s): RazerM
;
;===============================================================================
;
Func _SoundStatus($sSnd_id)
;return status
Return mciSendString("status " & FileGetShortName($sSnd_id) & " mode")
EndFunc ;==>_SoundStatus;===============================================================================
[/autoit][autoit][/autoit][autoit]
;
; Function Name: _SoundPos
; Description:: Returns the current position of the song
; Parameter(s): $sSnd_id - Sound ID returned by _SoundOpen or sound file,
; $iMode = 1 - hh:mm:ss, $iMode = 2 - milliseconds
; Requirement(s): AutoIt 3.2 ++
; Return Value(s): Current Position - Success, @error = 1 - $iMode is invalid
; Author(s): RazerM
;
;===============================================================================
;
Func _SoundPos($sSnd_id, $iMode = 1)
;Declare variables
Local $iSnd_pos_ms, $iSnd_pos_min, $iSnd_pos_hour, $iSnd_pos_sec, $sSnd_pos_format
;validate $iMode
If $iMode <> 1 And $iMode <> 2 Then Return SetError(1, 0, 0)
;tell mci to use time in milliseconds
mciSendString("set " & FileGetShortName($sSnd_id) & " time format miliseconds")
;receive position of sound
$iSnd_pos_ms = mciSendString("status " & FileGetShortName($sSnd_id) & " position")
;modify data and assign to variables
$iSnd_pos_min = Int($iSnd_pos_ms / 60000)
$iSnd_pos_hour = Int($iSnd_pos_min / 60)
$iSnd_pos_sec = Int(Int($iSnd_pos_ms / 1000) - ($iSnd_pos_min * 60))
;assign formatted data to $sSnd_pos_format
$sSnd_pos_format = StringFormat("%02i:%02i:%02i", $iSnd_pos_hour, $iSnd_pos_min, $iSnd_pos_sec)
;return correct variable
If $iMode = 1 Then Return $sSnd_pos_format
If $iMode = 2 Then Return $iSnd_pos_ms
EndFunc ;==>_SoundPos;===============================================================================
[/autoit][autoit][/autoit][autoit]
;
; Function Name: _SoundSetMasterVolume
; Description:: Sets the Master Volume. Does not control an application's volume
; Parameter(s): $$iVolume - % to set
; Requirement(s): AutoIt 3.2 ++
; Return Value(s): 1 - Success, 0 - Failure
; Author(s): Volly
; Example: _SoundSetMasterVolume(100)
;
;===============================================================================
;
func _SoundSetMasterVolume($iVolume)
_SetMixerVolume($MIXERLINE_COMPONENTTYPE_DST_SPEAKERS, $iVolume)
If @error Then
SetExtended(0)
Return(@extended)
else
SetExtended(1)
Return(@extended)
endif
EndFunc;===============================================================================
[/autoit][autoit][/autoit][autoit]
;
; Function Name: _SoundGetMasterVolume
; Description:: Gets the Master Volume level
; Parameter(s): none
; Requirement(s): AutoIt 3.2 ++
; Return Value(s): 1 to 100 - Success, -1 - Failure
; Author(s): Volly
; Example: _SoundGetMasterVolume()
;
;===============================================================================
;
func _SoundGetMasterVolume()
$percent = _GetMixerVolume($MIXERLINE_COMPONENTTYPE_DST_SPEAKERS)
If @error Then
SetExtended(-1)
Return(@extended)
else
SetExtended($percent)
Return(@extended)
endif
EndFunc;===============================================================================
[/autoit][autoit][/autoit][autoit]
;
; Function Name: _SoundSetMicrophoneVolume
; Description:: Sets the Microphone input volume
; Parameter(s): $iVolume - % to set
; Requirement(s): AutoIt 3.2 ++
; Return Value(s): 1 - Success, 0 and @error = 1 - Failure
; Author(s): Volly
; Example: _SoundSetMicrophoneVolume(50)
;
;===============================================================================
;
func _SoundSetMicrophoneVolume($iVolume)
_SetMixerVolume($MIXERLINE_COMPONENTTYPE_SRC_MICROPHONE, $iVolume)
If @error Then
Exit
else
SetExtended(1)
Return(@extended)
endif
EndFunc;===============================================================================
[/autoit][autoit][/autoit][autoit]
;
; Function Name: _SoundGetMicrophoneVolume
; Description:: Gets the Microphone volume level
; Parameter(s): none
; Requirement(s): AutoIt 3.2 ++
; Return Value(s): 1 to 100 - Success, -1 - Failure
; Author(s): Volly
; Example: _SoundGetMicrophoneVolume()
;
;===============================================================================
;
func _SoundGetMicrophoneVolume()
$percent = _GetMixerVolume($MIXERLINE_COMPONENTTYPE_SRC_MICROPHONE)
If @error Then
SetExtended(-1)
Return(@extended)
else
SetExtended($percent)
Return(@extended)
endif
EndFunc;===============================================================================
[/autoit][autoit][/autoit][autoit]
;
; Function Name: _SoundGetPhoneVolume
; Description:: Gets the Phone volume on the modem
; Parameter(s): none
; Requirement(s): AutoIt 3.2 ++
; Return Value(s): 1 to 100 - Success, -1 - Failure
; Author(s): Volly
; Example: _SoundGetPhoneVolume()
; Notes: Some modems may not report volume levels. You will need to test.
;
;===============================================================================
;
func _SoundGetPhoneVolume()
$percent = _GetMixerVolume($MIXERLINE_COMPONENTTYPE_SRC_TELEPHONE)
If @error Then
SetExtended(-10)
Return(@extended)
else
SetExtended($percent)
Return(@extended)
endif
EndFunc;===============================================================================
[/autoit][autoit][/autoit][autoit]
;
; Function Name: _SoundSetVolumeCD
; Description:: Sets the Volume level on the CDRom
; Parameter(s): $iVolume - % to set
; Requirement(s): AutoIt 3.2 ++
; Return Value(s): 1 to 100 - Success, -1 - Failure
; Author(s): Volly
; Example: _SoundSetVolumeCD(45)
;
;===============================================================================
func _SoundSetVolumeCD($iVolume)
_SetMixerVolume($MIXERLINE_COMPONENTTYPE_SRC_COMPACTDISC, $iVolume)
If @error Then
Exit
else
SetExtended(1)
Return(@extended)
endif
EndFunc;===============================================================================
[/autoit][autoit][/autoit][autoit]
;
; Function Name: _SoundSetMasterWaveVolume
; Description:: Sets the Master Wave Volume level.
; Parameter(s): $iVolume - % to set
; Requirement(s): AutoIt 3.2 ++
; Return Value(s): 1 to 100 - Success, -1 - Failure
; Author(s): Volly
; Example: _SoundSetMasterWaveVolume(60)
;
;===============================================================================
func _SoundSetMasterWaveVolume($iVolume)
_SetMixerVolume($MIXERLINE_COMPONENTTYPE_SRC_WAVEOUT, $iVolume)
If @error Then
Exit
else
SetExtended(1)
Return(@extended)
endif
EndFunc;===============================================================================
[/autoit][autoit][/autoit][autoit]
;
; Internal Functions
;
;===============================================================================
Func mciSendString($string)
Local $iRet
$iRet = DllCall("winmm.dll", "int", "mciSendStringA", "str", $string, "str", "", "int", 65534, "hwnd", 0)
If Not @error Then Return $iRet[2]
EndFunc ;==>mciSendStringFunc RandomStr($len)
[/autoit][autoit][/autoit][autoit]
Local $string
For $iCurrentPos = 1 To $len
$string &= Chr(Random(97, 122, 1))
Next
Return $string
EndFunc ;==>RandomStrFunc _SetMixerVolume($MixerDevice, $percent)
[/autoit][autoit][/autoit][autoit]
;default mixer is always 0 (so far) which is last audio device installed or prefered deviced selected by user
SetExtended(10)
$curmixer = 0
Const $MM_MIXM_CONTROL_CHANGE = 0x3D1
Const $CALLBACK_WINDOW = 0x10000
OpenAllMixers($mixers)
If @error Then Exit
$hmxobj = MixerOpen($curmixer, 0, $MM_MIXM_CONTROL_CHANGE, BitOR($CALLBACK_WINDOW, $MIXER_OBJECTF_MIXER))
GetMXWaveoutID($mixers, $curmixer, $MixerDevice)
_SetVolume($mixers, $curmixer, $percent)
MixerClose($hmxobj)
CloseAllMixers($mixers)
SetExtended(1)
Return(@extended)
EndFunc ;==>_SetMixerVolumeFunc _GetMixerVolume($MixerDevice)
[/autoit][autoit][/autoit][autoit]
;default mixer is always 0 (so far) which is last audio device installed or prefered deviced selected by user
$curmixer = 0
Const $MM_MIXM_CONTROL_CHANGE = 0x3D1
Const $CALLBACK_WINDOW = 0x10000
OpenAllMixers($mixers)
If @error Then Exit
$hmxobj = MixerOpen($curmixer, 0, $MM_MIXM_CONTROL_CHANGE, BitOR($CALLBACK_WINDOW, $MIXER_OBJECTF_MIXER))
GetMXWaveoutID($mixers, $curmixer, $MixerDevice)
$savevolume = GetSetOutVolume($mixers, $curmixer, 0, 0)
$savevolume = BitAND($savevolume / 0xFFFF * 100, 0xffff)MixerClose($hmxobj)
[/autoit][autoit][/autoit][autoit]
CloseAllMixers($mixers)
Return $savevolume
EndFunc ;==>_GetMixerVolumeFunc _SetVolume(ByRef $mixers, ByRef $curmixer, ByRef $percent)
[/autoit][autoit][/autoit][autoit]
$x = Mod($percent * 0xffff, 100)
$percent = BitAND($percent * 0xffff / 100, 0xffff)
$percent = $percent + $x
GetSetOutVolume($mixers, $curmixer, $percent) ;this will also trigger callback routine
EndFunc ;==>_SetVolumeFunc GetSetOutVolume($mixers, $index, $vol = 0, $doset = 1)
[/autoit][autoit][/autoit][autoit]
Local $i, $x, $arraysize, $channels, $mtiems
Const $MIXERCONTROLDETAILS_UNSIGNED_SIZEOF = 4
Local $mixercontroldetails = DllStructCreate( _
"dword;" & _ ;DWORD cbStruct
"dword;" & _ ;DWORD dwControlID
"dword;" & _ ;DWORD cChannels;
"dword;" & _ ;HWND hwndOwner DWORD cMultipleItems;
"dword;" & _ ;DWORD cbDetails;
"dword") ;LPVOID paDetails;
If @error Then Return False
$mitems = $mixers[$index][$MIX_OUTMULTIEMS]
$channels = $mixers[$index][$MIX_OUTCHANNELS]
$arraysize = $channels
If $mitems Then $arraysize = $channels * $mitems
Local $plistbool = DllStructCreate("dword[" & $arraysize + 1 & "]") ;give me one mroe than needed
If @error Then Return False
$hmxobj = $mixers[$index][$MIX_HMXOBJ]
$mxcd = $mixercontroldetails
DllStructSetData($mxcd, $cbStruct, DllStructGetSize($mxcd))
DllStructSetData($mxcd, 2, $mixers[$index][$MIX_OUTCTRLID])
DllStructSetData($mxcd, 3, $mixers[$index][$MIX_OUTCHANNELS])
DllStructSetData($mxcd, 4, $mixers[$index][$MIX_OUTMULTIEMS])
DllStructSetData($mxcd, 5, $MIXERCONTROLDETAILS_UNSIGNED_SIZEOF) ;cbDetails to sizeof one unsigned struct
DllStructSetData($mxcd, 6, DllStructGetPtr($plistbool)) ;paDetails set ptr
$ret = DllCall("winmm.dll", "long", "mixerGetControlDetails", "hwnd", $hmxobj, "ptr", DllStructGetPtr($mxcd), "long", BitOR($MIXER_OBJECTF_HMIXER, $MIXER_GETCONTROLDETAILSF_VALUE))
If @error Then Return False
If $ret[0] = $MMSYSERR_NOERROR Then
$x = DllStructGetData($plistbool, 1, 1) ;just return right channel
For $i = 1 To $arraysize
DllStructSetData($plistbool, 1, $vol, $i) ;set left right to same value
Next ;i
If $doset Then $ret = DllCall("winmm.dll", "long", "mixerSetControlDetails", "hwnd", $hmxobj, "ptr", DllStructGetPtr($mxcd), "long", BitOR($MIXER_OBJECTF_HMIXER, $MIXER_SETCONTROLDETAILSF_VALUE))
Return $x
EndIf
Return False
EndFunc ;==>GetSetOutVolumeFunc GetMXWaveoutID(ByRef $mixers, $index, $linetype)
[/autoit][autoit][/autoit][autoit]
Local $mitems, $chans, $hmxobj, $x, $ret, $lineid
;local structures are nuked on exit...so i have read..LOL
Local $mixercontrol = DllStructCreate( _
"dword;" & _ ; DWORD cbStruct;
"dword;" & _ ; DWORD dwControlID;
"dword;" & _ ; DWORD dwControlType;
"dword;" & _ ; DWORD fdwControl;
"dword;" & _ ; DWORD cMultipleItems;
"char[16];" & _ ;szShortName[MIXER_SHORT_NAME_CHARS];
"char[64];" & _ ;szName[MIXER_LONG_NAME_CHARS];
"dword;" & _ ;lMinimum
"dword;" & _ ;lMaximum
"dword[4];" & _ ;dwReserved[4];
"dword;" & _ ;cSteps
"dword[5]") ; DWORD dwReserved[6];
If @error Then Return False
Local $mixerlinecontrols = DllStructCreate( _
"dword;" & _ ; cbStruct;
"dword;" & _ ; DWORD dwLineID;
"dword;" & _ ; DWORD dwControlID DWORD dwControlType;
"dword;" & _ ; DWORD cControls;
"dword;" & _ ; DWORD cbmxctrl;
"ptr") ; LPMIXERCONTROL pamxctrl;
If @error Then Return False
$hmxobj = $mixers[$index][$MIX_HMXOBJ]
zeroline($mxline)
$mxline[$dwLineID] = BitOR($index, 0xFFFF0000)
$mxline[$dwComponentType] = $linetype
MixerGetLineInfo($hmxobj, $mxline, $MIXER_GETLINEINFOF_COMPONENTTYPE)
$lineid = $mxline[$dwLineID]
DllStructSetData($mixerlinecontrols, $cbStruct, DllStructGetSize($mixerlinecontrols))
DllStructSetData($mixerlinecontrols, 2, $lineid)
DllStructSetData($mixerlinecontrols, 3, $MIXERCONTROL_CONTROLTYPE_VOLUME)
DllStructSetData($mixerlinecontrols, 4, 1)
DllStructSetData($mixerlinecontrols, 5, DllStructGetSize($mixercontrol))
DllStructSetData($mixerlinecontrols, 6, DllStructGetPtr($mixercontrol))
$ret = DllCall("winmm.dll", "long", "mixerGetLineControls", "hwnd", $hmxobj, "ptr", DllStructGetPtr($mixerlinecontrols), "long", BitOR($MIXER_OBJECTF_HMIXER, $MIXER_GETLINECONTROLSF_ONEBYTYPE))
If $ret[0] <> $MMSYSERR_NOERROR Then Return False
$chans = $mxline[$cChannels]
$x = DllStructGetData($mixercontrol, 4) ;fwControl
If BitAND($x, $MIXERCONTROL_CONTROLF_UNIFORM) Then $chans = 1
$mitems = 0
If BitAND($x, $MIXERCONTROL_CONTROLF_MULTIPLE) Then $mitems = DllStructGetData($mixercontrol, 5)
$x = DllStructGetData($mixercontrol, 3) ;fwControl
If BitAND($x, $MIXERCONTROL_CT_CLASS_FADER) Then
$mixers[$index][$MIX_OUTCHANNELS] = $chans
$mixers[$index][$MIX_OUTMULTIEMS] = $mitems
$mixers[$index][$MIX_OUTCTRLID] = DllStructGetData($mixercontrol, 2)
Return True
EndIf
Return False
EndFunc ;==>GetMXWaveoutIDFunc zeroline(ByRef $line)
[/autoit][autoit][/autoit][autoit]
Local $i
For $i = 0 To UBound($line) - 1
$line[$i] = 0
Next ;i
EndFunc ;==>zerolineFunc MixerGetLineInfo($hmxobj, ByRef $line, $flag)
[/autoit][autoit][/autoit][autoit][/autoit][autoit]
Local $mixerline = DllStructCreate ("dword;dword;dword;dword;dword;dword;dword;dword;dword;dword;char[16];char[64];dword;dword;short;short;dword;char[32]")
If @error Then
SetError(1)
Return False
EndIf
Local $i
For $i = 1 To UBound($line) - 1
DllStructSetData($mixerline, $i, $line[$i])
Next ;i
DllStructSetData($mixerline, $cbStruct, DllStructGetSize($mixerline))
$ret = DllCall("winmm.dll", "long", "mixerGetLineInfo", "hwnd", $hmxobj, "ptr", DllStructGetPtr($mixerline), "int", $flag)
If @error Then
SetError(1)
Return False
EndIf
For $i = 1 To $szMPname
$line[$i] = DllStructGetData($mixerline, $i)
Next ;i
If $ret[0] = $MMSYSERR_NOERROR Then Return True
SetError(1)
Return False
EndFunc ;==>MixerGetLineInfo;On Exit: MIX_HMXOBJ set to return value from mixeropn...check for @error
[/autoit][autoit][/autoit][autoit]
Func OpenAllMixers(ByRef $mixers)
Local $i, $mxnumdevs, $hmxobj
$mxnumdevs = mixerGetNumDevs()
If $mxnumdevs Then
ReDim $mixers[$mxnumdevs + 1][$AMIX_SIZEOF]
For $i = 0 To $mxnumdevs - 1
$hmxobj = MixerOpen($i, 0, 0, $MIXER_OBJECTF_MIXER)
If @error Then
SetError(1)
Return False
EndIf
$mixers[$i][$MIX_HMXOBJ] = $hmxobj
Next ;i
EndIf
$mixers[0][0] = $mxnumdevs
EndFunc ;==>OpenAllMixers;On ENtry: mixer id and flag(s) , if no id passed then the preffered id is used (0) ditto for flag
[/autoit][autoit][/autoit][autoit]
;on exit: mixer handle
Func MixerOpen($uMxid = 0, $hwnd = 0, $instance = 0, $fdwOpen = 0)
Local $x, $h_struct
$h_struct = DllStructCreate("udword") ;since a local will be deleted on exit of function
If @error Then
SetError(1)
Return False
EndIf
$ret = DllCall("winmm.dll", "long", "mixerOpen", "ptr", DllStructGetPtr($h_struct), "int", $uMxid, "int", $hwnd, "int", $instance, "int", $fdwOpen)
If Not @error Then
If $ret[0] <> $MMSYSERR_NOERROR Then Return -1
$x = DllStructGetData($h_struct, 1)
Return $x
EndIf
SetError(1)
Return False
EndFunc ;==>MixerOpenFunc CloseAllMixers($mixers)
[/autoit][autoit][/autoit][autoit]
Local $i, $cnt
$cnt = $mixers[0][0]
For $i = 0 To $cnt - 1
MixerClose($mixers[$i][$MIX_HMXOBJ])
Next ;i
EndFunc ;==>CloseAllMixers;On Entry: mixer handle
[/autoit][autoit][/autoit][autoit]
Func MixerClose($hmxobj)
$ret = DllCall("winmm.dll", "long", "mixerClose", "long", $hmxobj)
If Not @error Then Return True
Return False
EndFunc ;==>MixerCloseFunc mixerGetNumDevs()
[/autoit][autoit][/autoit][autoit]
$ret = DllCall("winmm.dll", "long", "mixerGetNumDevs")
If Not @error Then Return $ret[0]
SetError(1)
Return False
EndFunc ;==>mixerGetNumDevs;~ $re = _isMute(1000)
[/autoit][autoit][/autoit][autoit]
;~ If @error Then ConsoleWrite(@error & @CRLF)
;~ ConsoleWrite($re & @CRLF)
;===============================================================================
;
; Function Name: _isMute
; Description:: Check for mute sound
; Parameter(s): ControlID
; Voulme = 1000
; Wave = 2000
; SW-Synthesizer = 3000
; CD-Player = 4000
; Mikrofon = 5000
; Line-In = 6000
; Requirement(s): ---
; Return Value(s): 0 = not muted, 1 = muted, -1 = timeout, -2 = ControlID not found
; Author(s): Thorsten Meger (Xenobiologist)
;
;===============================================================================Func _isMute($opt = 1000)
[/autoit]
Local $retVal = 0, $ex = False
If Not WinExists('[CLASS:Volume Control]') Then
Run('sndvol32', '', @SW_HIDE)
$ex = True
EndIf
If WinWait('[CLASS:Volume Control]', '', 2) = 0 Then Return -1
$retVal = ControlCommand('[CLASS:Volume Control]', '', $opt, 'isChecked')
If @error Then Return -2
If $ex = True Then WinClose('[CLASS:Volume Control]')
Return $retVal
EndFunc ;==>_isMute -
boa krass verwende doch bitte die spoiler, 1000 zeilen code braucht man nicht unbedingt dastehn haben...
die audio.au3 die du da hast ist eher zum soundabspielen und so...
soweit ich das richtig überflogen habe.verwende doch die bass.au3. das sieht eher nach dem aus was du suchst
die funktionen
Spoiler anzeigen
; _BASS_SetConfig()
; _BASS_GetConfig()
; _BASS_SetConfigPtr()
; _BASS_GetConfigPtr()
; _BASS_GetVersion()
; _BASS_ErrorGetCode()
; _BASS_GetDeviceInfo()
; _BASS_Init()
; _BASS_SetDevice()
; _BASS_GetDevice()
; _BASS_Free()
; _BASS_GetDSoundObject()
; _BASS_GetInfo()
; _BASS_Update()
; _BASS_GetCPU()
; _BASS_Start()
; _BASS_Stop()
; _BASS_Pause()
; _BASS_SetVolume()
; _BASS_GetVolume()
; _BASS_PluginLoad()
; _BASS_PluginFree()
; _Bass_PluginGetInfo_Sample()
; _BASS_Set3DFactors()
; _BASS_Get3DFactors()
; _BASS_Set3DPosition()
; _BASS_Get3DPosition()
; _BASS_Apply3D()
; _BASS_SetEAXParameters()
; _BASS_GetEAXParameters()
; _BASS_MusicLoad()
; _BASS_MusicFree()
; _BASS_SampleLoad()
; _BASS_SampleCreate()
; _BASS_SampleFree()
; _BASS_SampleSetData()
; _BASS_SampleGetData()
; _BASS_SampleGetInfo()
; _BASS_SampleSetInfo()
; _BASS_SampleGetChannel()
; _BASS_SampleStop()
; _BASS_Startup()
; _BASS_StreamCreate()
; _BASS_StreamCreateFile()
; _BASS_StreamCreateURL()
; _BASS_StreamFree()
; _BASS_StreamGetFilePosition()
; _BASS_StreamPutData()
; _BASS_StreamPutFileData()
; _BASS_RecordGetDeviceInfo()
; _BASS_RecordInit()
; _BASS_RecordSetDevice()
; _BASS_RecordGetDevice()
; _BASS_RecordFree()
; _BASS_RecordGetInfo()
; _BASS_RecordGetInputName()
; _BASS_RecordSetInput()
; _BASS_RecordGetInput()
; _BASS_RecordStart()
; _BASS_ChannelBytes2Seconds()
; _BASS_ChannelSeconds2Bytes()
; _BASS_ChannelGetDevice()
; _BASS_ChannelSetDevice()
; _BASS_ChannelIsActive()
; _BASS_ChannelGetInfo()
; _BASS_ChannelGetTags()
; _BASS_ChannelFlags()
; _BASS_ChannelUpdate()
; _BASS_ChannelLock()
; _BASS_ChannelPlay()
; _BASS_ChannelStop()
; _BASS_ChannelPause()
; _BASS_ChannelSetAttribute()
; _BASS_ChannelGetAttribute()
; _BASS_ChannelSlideAttribute()
; _BASS_ChannelIsSliding()
; _BASS_ChannelGet3DAttributes()
; _BASS_ChannelSet3DAttributes()
; _BASS_ChannelSet3DPosition()
; _BASS_ChannelGet3DPosition()
; _BASS_ChannelGetLength()
; _BASS_ChannelSetPosition()
; _BASS_ChannelGetPosition()
; _BASS_ChannelGetLevel()
; _BASS_ChannelGetData()
; _BASS_ChannelSetLink()
; _BASS_ChannelRemoveLink()
; _BASS_ChannelSetFX()
; _BASS_ChannelRemoveFX()
; _BASS_SetEAXPreset()
; _BASS_ChannelSetFX()
; _BASS_ChannelRemoveFX()
; _BASS_FXGetParameters()
; _BASS_FXSetParameters()
; _BASS_ChannelSetVolume()
; _BASS_ChannelGetVolume -
Vielen Dan aber ich habe was gefunden was autoit von hauseaus hat
[autoit]
und zwar dieses hier"{VOLUME_DOWN}") "{VOLUME_UP}") "{VOLUME_Mute}")
[/autoit]steht zwar das XP only geht aber bei Win 7 und Vista
Jeztz nur meine frage:Wie zum Teufel verbinde ich das mit dem Slider ?
-
Mit einem Slider geht es wohl nur mit der oben genannten Funktion: Limit vom Slider auf 100 und dann kann man den Slider auslesen und damit wavevolume ändern
-
Könnte man dann nicht theoretisch aus 50x {Volume_Down} machen?
Aber es ist besser das mit SoundSetWaveVolume zu machen.
-
-
SEuBo
Ok danke mal wieder was dazugelerntIch habe das jetzt mal gemacht
[autoit]
So solte das gehen:#include <ButtonConstants.au3>
[/autoit][autoit][/autoit][autoit]
#include <GUIConstantsEx.au3>
#include <SliderConstants.au3>
#include <WindowsConstants.au3>#Region ### START Koda GUI section ### Form=
[/autoit][autoit][/autoit][autoit]
$Form1 = GUICreate("Form1", 170, 105, 192, 124)
$Slider1 = GUICtrlCreateSlider(8, 24, 150, 45)
$Button1 = GUICtrlCreateButton("OK", 32, 72, 75, 25, 0)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###While 1
[/autoit]
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
$Read=GUICtrlRead($Slider1)
ToolTip($Read)
SoundSetWaveVolume($Read)
EndSwitch
WEndIch konnte das leider nicht ausprobieren da an dem Laptop leider das SoundSystem Defekt ist!
Kann mir dann einer sagen ob das geht???
-
Funktinoieren tuts. Aber es wird ja nur die Lautstärke vom AutoIt Prozess geändert. Für mich wäre das also relativ nutzlos.