montoyo/webdisplays

Microfone Input + Webcamera

Opened this issue · 3 comments

Hi. can you make enchament adding Input Microfone and Webcamera Adding items
Usb Controller block and Input Microfone sensor and Video sensor with selection Which use Like Realtek Speaker or PHL display output like in micorofone pls make this.

import javax.sound.sampled.*;

public class MicListener {

AudioFormat format = new AudioFormat(...);
TargetDataLine line;

public MicListener(){
try{
line = AudioSystem.getTargetDataLine(format);
line.open(format);
line.start();
}catch(Exception e){
e.printStackTrace();
}
}

public void listen(){
byte[] buffer = new byte[line.getBufferSize() / 5];
line.read(buffer, 0 , buffer.length);

 //Check microphone input     
 if(microphoneLoudEnough()){
   //Trigger Webdisplays action  
 }     
 if(voiceCommandDetected()){
    //Trigger Webdisplays action  
 }     
//Other checks                

}

private boolean microphoneLoudEnough(){...}
private boolean voiceCommandDetected(){...}

}
I Even Code Make Just Make Mod What add

I'l be Waiting montoyo

no you can't