Controlling Your PC's Volume with Python

preview_player
Показать описание
In this video, we learn how to control our PC's volume using Python.

◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾
📚 Programming Books & Merch 📚

🌐 Social Media & Contact 🌐

Рекомендации по теме
Комментарии
Автор

Without looking at the docs, I would say master volume is set using a decibel (dB) scale. It is a log scale common in audio. +6db of difference in signal level corresponds to a doubling of perceived sound level.
This is due to the fact that the relationship between actual sound pressure levels and perceived volume is a log (not linear) relationship. For this reason most volume control potentiometers (variable resistors) use a log taper, not linear.
Audio filters (high pass, band pass, etc) are usually characterized by how quickly volume varies as a function of frequency and is expressed in dB per octave.
Cool stuff as always! 👍

thomasgoodwin
Автор

Thank you very much man, helped a lot. I used this with your motion detection vid to sound an alarm at full volume. ❤❤

mihionline
Автор

I'm trying to build volume mixer device. It was a great success on Linux, no casting pointer just working with system wide libraries. It took about 1h of reading documentation and two hours of coding.

Windows path by comparison is comical if I'm being honest. I don't know what infuriates me more, the fact that you need to cast objects to be able to talk to the system API or the fact that powershell does not have anything baked in to process this simple task.

My device is super simple, it has 3 sliding potentiometers, connected to a microcontroller that outputs the values of the analog read onto a COM port. Values are from 0 to 100. Now in order to make it work on Windows I need to go through the spaghetti translations of low level access and all shenanigans of mapping the values and understanding the relations between the controls. Don't get me wrong, it is logical that the process volume is only a percentage of the master volume, but it's odd that no one at Microsoft decided to simplify it a bit.

kamilkurzynowski
Автор

There are a lot of users who after migrating to Windows 10 had problems with the laptop's speakers. When using an application, for example, youtube, after a while (between 30 seconds and 1 minute 30 seconds) they stop working and start working again after a few minutes. I have tried to use AIs like GPT-3 or GPT-4, Sage, etc... to make a python module that reset (mute/unmute) speakers in 1 sec. without success. When it is not a library, it is an argument or a variable. Could you indicate some lines to simply reset the speakers? No other solutions like driver update solved the bug and unaffortunatly there is no support for. Just in case you might suggest a few lines of code...Thanks in advance

josev
Автор

And control microphone and microphone effects with python, is it possible? Help me please

CarmoDavi
Автор

Which to learn between C and C++? Which is better if I already know python?

artyommart
Автор

Hey thank you for the video? i need some help with this library if youcould help me out. I want to mute and unmute different soundcards on my windows system and not just the mastervolume and it's applications, you think its possible?

akhmedmourdalov
Автор

Would it be possible to re-label the audio levels? So, instead of the numerical intervals, it could be “low, medium, high”?

zanerose
Автор

any idea what is causing `ImportError: No module named api.audioclient`?

triggerre
Автор

Is there a way I can make it that it exceeds the max volume of windows I was using lefta sound booster and thought it was free but now it says it wants me to renew the plan

synctic
Автор

Looks handy, unfortunately, I was not able to get pycaw to install. "Failed building wheel for psutil"

gpraceman
Автор

Which is easier to learn between C and C++?

artyommart
Автор

How can I make it show me the .exe of the app that I want to control the sound of in a drop-down menu?

edsketchs
Автор

I am getting an AttributeError: type object 'IAudioEndpointVolume' has no attribute '__iid__'. Did you men: '__dir__'? So Im dead in the water 2mins 59secs into the tutorial :(

logansfury
Автор

its showing ImportEtror DLL failed to load.

plz help

windgod
Автор

in my case, 'Activate' argument was error.

muhammadfauzan
Автор

Linux ? Comtypes Only Works on Windows...!

lsauce
Автор

What kind of monster doesn't put it in the description? Now I have to write all of that...

mahmoudbamian
Автор


I made a loop with it

funny 😂😂😂😂😂😂😂😂😂😂😂😂😂😂

nasser_akm
Автор

I get a NameError: name 'AudioUtilities' is not defined

I am a n00bs

stevenrempel