I wrote my own code to record what I say through the microphone. I would like to understand the function that Google uses to stop this recording when there is โsilenceโ. For example, if I go to Google and click on the microphone symbol, I can say that I plan to search, but what is the function that it uses to understand the moment when I say nothing (the moment of โsilenceโ)? I was thinking of making a loop in which they record several dB or RMS from several sound frames, and in comparison I can understand if there is "silence". still time is static.
public static void main(String[] args) { final Main REGISTRAZIONE = new Main(); Thread TIME = new Thread(new Runnable() { public void run() { try { Thread.sleep(RECORD_TIME); } catch (InterruptedException ex) { ex.printStackTrace(); } REGISTRAZIONE.finish(); } }); TIME.start(); REGISTRAZIONE.start(); }
source share