In my application I want get and set output volume. I saw examples in internet. Base problem is find proper mixer and line. I use AudioSystem.getMixerInfo() and mixerInfo.getName(). I am from Poland and have Polish Windows and therefore names are in Polish, for example "Podstawowy sterownik d?wi?k" with chars "?". Description and names are useless and I can't find methods to distinguish and find proper line to control it. Is possible to get a piece of code to get current volume and change it?
Asked
Active
Viewed 309 times
1
-
1I have example https://github.com/Kunagi/ilarkesto/blob/master/src/main/java/ilarkesto/media/Audio.java but there is searched string "Master" which not found at me. – AndrzejB Jul 12 '15 at 19:28
-
Sample code from Stack question:10624202 give me three values 0.92, 1.0 and 0.85 whereas my system (global) volume control has other value. In internet I found (Stack:14301618) that it is impossible to change the system volume in Java. For FloatControl.Type.MASTER_GAIN is Exception (at least for high version of Windows) – AndrzejB Jul 12 '15 at 21:56
-
In pure Java it is impossible (?) but with JNI? In Stack:3249550 is C++ DLL example. I try run code as exec and it works! Probably JNI is a solution, but working on Windows 8.1 raises the question control volume in Linux. – AndrzejB Jul 12 '15 at 22:19