java - Get default Microphone for settings -
i not able detect default microphone volume settings on windows without using jni. tried several ways not work expected
public static float getvolume() { float volume = 0; try { if (audiosystem.islinesupported(port.info.microphone)) { port lineinx = (port) audiosystem.getline(port.info.microphone); lineinx.open(); floatcontrol fx = null; control[] vx = lineinx.getcontrols(); fx = getvolumecontrol(vx, 0); volume = fx.getvalue(); lineinx.close(); } } catch (exception ex) { } return volume; }
Comments
Post a Comment