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

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

keyboard - C++ GetAsyncKeyState alternative -

android - java.net.UnknownHostException(Unable to resolve host “URL”: No address associated with hostname) -