4

I wrote on my own a set of code to record what I say through a microphone. I would like to understand the function that google uses for stopping this recording when there is "silence". For example if I go on google and press the microphone symbol, I can say what I plan to look for, but what is the function that it uses to understand the moment when I do not say anything (the moment of "silence")? I thought about doing a cycle in which they are recording some dB or RMS of a few sound frames, and by comparison I can understand if there's "silence". until now the 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();
}
4

1 に答える 1