Reproducir Sonidos en Java
public class Midi {
public static void main (String[] args) { int freq = Integer.parseInt(args[0]); int volu = Integer.parseInt(args[1]); Synthesizer syn = null; try { syn = MidiSystem.getSynthesizer(); } catch(MidiUnavailableException ext) { System.out.println("Exception"); } catch(Exception ext) { System.out.println("Exception"); } try { syn.open(); } catch(MidiUnavailableException exc) { System.out.println("Exception"); } MidiChannel[] canales; MidiChannel canal; for(int i=0;i<=1;i++) { canales = syn.getChannels(); canal = canales[9]; canal.noteOn(freq,volu); try { Thread.sleep(500); } catch(InterruptedException exp) { System.out.println("Exception"); } canal.noteOff(freq); } for(int i=0;i<=6;i++) { canales = syn.getChannels(); canal = canales[9]; canal.noteOn(freq,volu); try { Thread.sleep(250); } catch(InterruptedException exp) { System.out.println("Exception"); }
/*********Servidor*********/
/*********Cliente*********/
Comentarios recientes
hace 8 horas 3 mins
hace 10 horas 12 mins
hace 12 horas 34 mins
hace 14 horas 34 mins
hace 15 horas 13 mins
hace 15 horas 37 mins
hace 15 horas 37 mins
hace 17 horas 43 mins
hace 21 horas 34 mins
hace 22 horas 15 mins