Can Java Sound be used to control the system volume?

No, it cannot. Here is source adapted from an answer to Adjusting master volume on coderanch. The source iterates the available lines, checks if they have a control of the right type, and if so, puts them in a GUI attached to a JSlider import java.awt.*; import javax.swing.*; import javax.sound.sampled.*; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; public … Read more

Set ALSA master volume from C code

The following works for me. The parameter volume is to be given in the range [0, 100]. Beware, there is no error handling! void SetAlsaMasterVolume(long volume) { long min, max; snd_mixer_t *handle; snd_mixer_selem_id_t *sid; const char *card = “default”; const char *selem_name = “Master”; snd_mixer_open(&handle, 0); snd_mixer_attach(handle, card); snd_mixer_selem_register(handle, NULL, NULL); snd_mixer_load(handle); snd_mixer_selem_id_alloca(&sid); snd_mixer_selem_id_set_index(sid, 0); … Read more

Getting individual windows application current volume output level as visualized in audio Mixer

You can use CSCore. There is a wrapper for the CoreAudioAPI-Audiosessions. Use something like that (for more details take a look at the unittests: AudioSession-UnitTests): private static void Main(string[] args) { using (var sessionManager = GetDefaultAudioSessionManager2(DataFlow.Render)) { using (var sessionEnumerator = sessionManager.GetSessionEnumerator()) { foreach (var session in sessionEnumerator) { using (var audioMeterInformation = session.QueryInterface<AudioMeterInformation>()) { … Read more