Skip to content Skip to sidebar Skip to footer

How Do I Change The Volume Of Chrome Using Selenium

I am working on a project that receives information from an Atmel board using python, and I needed to change the chrome browser volume. I am trying to use selenium but I only found

Solution 1:

You do not need selenium to do it. You need pycaw to control the volume of the application running on your system, here is an example of how to do it.

from __future__ import print_function
from pycaw.pycaw import AudioUtilities, ISimpleAudioVolume


sessions = AudioUtilities.GetAllSessions()
for session in sessions:
    volume = session._ctl.QueryInterface(ISimpleAudioVolume)
    if session.Process and session.Process.name() == "chrome.exe":
        volume.SetMasterVolume(0.5, None)

Post a Comment for "How Do I Change The Volume Of Chrome Using Selenium"