G
G
gd1xza2021-03-02 14:07:34
C++ / C#
gd1xza, 2021-03-02 14:07:34

Is it possible to programmatically change the volume in Windows?

Is it possible to change the volume of the main audio device in the cpp with a code?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
Stalker_RED, 2021-03-02
@Stalker_RED

ISimpleAudioVolume::SetMasterVolume
There are also a bunch of third-party utilities like nircmd or setvol that allow you to control the volume via the command line or hotkeys.
nircmd is generally cool, in addition to volume, it can do a lot of things.

V
Vasily Bannikov, 2021-03-02
@vabka

Yes, via winapi
https://stackoverflow.com/questions/294292/changin...

R
res2001, 2021-03-02
@res2001

If you are interested, audacity (an open-source music editor) used to make the portmixer library, it is designed to work in conjunction with the portaudio library. Portmixer is included with the audacity source.
This portmixer is designed to change the volume, and this is a cross-platform option.
Changing the volume is not a trivial process, and it is not done with a single call to WinAPI.
If you want, you can take the sources of portmixer and modify them for yourself.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question