montoyo / webdisplays

WebDisplays mod for Minecraft 1.12.2
Other
97 stars 52 forks source link

Microfone Input + Webcamera #229

Open Andrew482c opened 1 year ago

Andrew482c commented 1 year ago

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.

Andrew482c commented 1 year ago

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

Andrew482c commented 1 year ago

I'l be Waiting montoyo

itsskyballs commented 10 months ago

no you can't