helloworld
Goto Top

Lautstärke mit AutoIt ändern

Hey erstmal frohes neues Jahr euch
Ich weiß ich schreibe spät
Ich habe versucht mit AutoIT die Lautstärke
meines PC zu ändern mit
SoundSetWaveVolume, 50
Jedoch klappt der Befehl nicht
Was ist da falsch?!

Content-Key: 359599

Url: https://administrator.de/contentid/359599

Printed on: April 20, 2024 at 05:04 o'clock

Member: Voiper
Voiper Jan 02, 2018 at 07:01:41 (UTC)
Goto Top
Moin,

ebenfalls frohes Neues.

Ein Blick in die Doku sagt folgendes:

This controls the Wave volume, not the master volume control. Also, a value of Zero does not set mute status.

On Windows Vista, there is no system-wide wave volume. This function only changes the wave volume for the script. It can not be used to change the wave volume of other programs.

Ein explizites Kommando gibt es dafür meines Wissens nicht. Alternativ kannst du selber was schreiben. Ein Beispiel:

https://www.autoitscript.com/forum/topic/149654-set-system-volume/

Gruß. V
Member: Pjordorf
Pjordorf Jan 02, 2018 at 13:40:39 (UTC)
Goto Top
Hallo,

Zitat von @HelloWorld:
Ich habe versucht mit AutoIT die Lautstärke meines PC zu ändern mit
SoundSetWaveVolume, 50
Sollte der Wert nicht in runden Klammern stehen?

Jedoch klappt der Befehl nicht
Sondern? Irgendetwas passiert zu 100%, nur willst du uns das nicht sagen. face-smile Geht vielleicht das Licht in dein Zimmer aus?

Was ist da falsch?!
Wird dein Programm denn überhaupt ausgeführt? Wird dieser Befehl überhaupt mit den richtigen Rechten ausgeführt? Hat dieser Rechner denn überhaupt WAVE? Das ist sicherlich nicht alles von dein SutoIT Skript, oder?

Mal geschaut ob es überhaupt das richtige Gerät ist welches die Lautstärke verändert? Mal im Internet gesucht? https://www.autoitscript.com/forum/topic/148753-is-there-a-way-to-get-th ... gefunden über https://www.google.de/search?q=autoit+windows+10+lautst%C3%A4rke , ob es dir hilft - k.a.

Nur Fragen, Fragen, Fragen....

Gruß,
Peter
Member: BassFishFox
BassFishFox Jan 02, 2018 updated at 20:00:10 (UTC)
Goto Top
Hallo,

Das klappt schon, auch mit W10. Schau Dir mal diesen Code an. Da ist alles drin was Du brauchst bzw. wissen musst.

#include <MsgBoxConstants.au3>

MsgBox(64, "Easter", "You have entered the program", 30)  

; Set volume to 100% (Windows actually does 2 steps increments for the volume)
Local $i = 0
While $i <= 50
    Send("{VOLUME_UP}", 0)  
    $i = $i + 1
WEnd

; Sets the system wave volume to 100%. This controls the Wave volume, not the master volume control. Also, a value of Zero does not set mute status.
SoundSetWaveVolume(100)

; Play one of the default sytem sounds
SoundPlay(@WindowsDir & "\media\tada.wav",1)  

MsgBox(64, "Easter", "The previous sound was played at 100%, the next one will be at 50%", 30)  

; Set volume from 100% to 50%
Local $i = 0
While $i <= 25
    Send("{VOLUME_Down}", 0)  
    $i = $i + 1
WEnd

; Sets the system wave volume to 100%. This controls the Wave volume, not the master volume control. Also, a value of Zero does not set mute status.
SoundSetWaveVolume(100)

; Play one of the default sytem sounds
SoundPlay(@WindowsDir & "\media\tada.wav",1)  

MsgBox(64, "Egg", "You are leaving the program", 30)  

Stammt von hier.
https://www.autoitscript.com/forum/topic/127425-set-windows-volume/#comm ...

Was Du nicht benoetigst nimmst Du raus oder aenderst halt ab. face-smile

Denke daran, das der o.g. Code das "MasterVolume" aendert. Explizit nur die Lautstaerke von den Systemsounds oder einem anderen im Mixer gelisteten Geraet ist was anderes.


BFF