kao,怎么难谁会!!!!!!!!
kao,怎么难谁会!!!!!!!!
kao,怎么难谁会!!!!!!!!
kao,怎么难谁会!!!!!!!!
kao,怎么难谁会!!!!!!!!
kao,怎么难谁会!!!!!!!!
kao,怎么难谁会!!!!!!!!
kao,怎么难谁会!!!!!!!!
kao,怎么难谁会!!!!!!!!
kao,怎么难谁会!!!!!!!!
kao,怎么难谁会!!!!!!!!
kao,怎么难谁会!!!!!!!!
kao,怎么难谁会!!!!!!!!
kao,怎么难谁会!!!!!!!!
kao,怎么难谁会!!!!!!!!
kao,怎么难谁会!!!!!!!!
kao,怎么难谁会!!!!!!!!
kao,怎么难谁会!!!!!!!!
kao,怎么难谁会!!!!!!!!
kao,怎么难谁会!!!!!!!!
kao,怎么难谁会!!!!!!!!kao,怎么难谁会!!!!!!!!
kao,怎么难谁会!!!!!!!!
kao,怎么难谁会!!!!!!!!kao,怎么难谁会!!!!!!!!
kao,怎么难谁会!!!!!!!!
kao,怎么难谁会!!!!!!!!
kao,怎么难谁会!!!!!!!!
kao,怎么难谁会!!!!!!!!
kao,怎么难谁会!!!!!!!!
kao,怎么难谁会!!!!!!!!
kao,怎么难谁会!!!!!!!!
kao,怎么难谁会!!!!!!!!
kao,怎么难谁会!!!!!!!!
kao,怎么难谁会!!!!!!!!
kao,怎么难谁会!!!!!!!!
kao,怎么难谁会!!!!!!!!
kao,怎么难谁会!!!!!!!!
kao,怎么难谁会!!!!!!!!
kao,怎么难谁会!!!!!!!!
kao,怎么难谁会!!!!!!!!
kao,怎么难谁会!!!!!!!!
kao,怎么难谁会!!!!!!!!
kao,怎么难谁会!!!!!!!!
kao,怎么难谁会!!!!!!!!
kao,怎么难谁会!!!!!!!!
kao,怎么难谁会!!!!!!!!
kao,怎么难谁会!!!!!!!!
kao,怎么难谁会!!!!!!!!
kao,怎么难谁会!!!!!!!!
kao,怎么难谁会!!!!!!!!
kao,怎么难谁会!!!!!!!!
kao,怎么难谁会!!!!!!!!
kao,怎么难谁会!!!!!!!!
kao,怎么难谁会!!!!!!!!
kao,怎么难谁会!!!!!!!!
kao,怎么难谁会!!!!!!!!
kao,怎么难谁会!!!!!!!!
kao,怎么难谁会!!!!!!!!kao,怎么难谁会!!!!!!!!
kao,怎么难谁会!!!!!!!!
kao,怎么难谁会!!!!!!!!kao,怎么难谁会!!!!!!!!
kao,怎么难谁会!!!!!!!!
kao,怎么难谁会!!!!!!!!
kao,怎么难谁会!!!!!!!!
kao,怎么难谁会!!!!!!!!
kao,怎么难谁会!!!!!!!!
kao,怎么难谁会!!!!!!!!
kao,怎么难谁会!!!!!!!!
kao,怎么难谁会!!!!!!!!
kao,怎么难谁会!!!!!!!!
kao,怎么难谁会!!!!!!!!
kao,怎么难谁会!!!!!!!!
kao,怎么难谁会!!!!!!!!
kao,怎么难谁会!!!!!!!!
kao,怎么难谁会!!!!!!!!
Plays the audio clip at the specified absolute URL.
void play(URL url, String name)
Plays the audio clip given the URL and a specifier that is relative to it
play 是播放声音文件的方法阿!
我的意思是让扬声器发声!
java中有一个beep()方法!但是它的声音是单一频率的!
怎样才能向c 或汇编那样让扬声器发出不同频率的声音!
import javax.sound.midi.*;public class Beeper {
public void beep(int notePitch,int duration) {
beep(notePitch,duration,100,100,0);
}
public static void beep(int notePitch,long duration,int velocity,int numInstr,int numChannel) {
Synthesizer mySynthesizer=null;
try {
mySynthesizer = MidiSystem.getSynthesizer();
if ( mySynthesizer == null) {
System.out.println("getSynthesizer() failed!");
return;
}
mySynthesizer.open();
}catch (Exception ex) {
ex.printStackTrace();
return;
}
Instrument[] instruments=mySynthesizer.getAvailableInstruments();
if(numInstr<0) numInstr=0;
else if(numInstr>=instruments.length)
numInstr=instruments.length-1;
Instrument myInstrument=instruments[numInstr];
mySynthesizer.loadInstrument(myInstrument);
MidiChannel[] channels = mySynthesizer.getChannels();
if(numChannel<0) numChannel=0;
else if(numChannel>=channels.length)
numChannel=channels.length-1;
MidiChannel channel = channels[numChannel];
int prog = myInstrument.getPatch().getProgram();
channel.programChange(prog);
channel.noteOn(notePitch,velocity);
try {
Thread.currentThread().sleep(duration);
} catch(InterruptedException ie) { }
channel.allNotesOff();
if (mySynthesizer.isOpen())
mySynthesizer.close();
mySynthesizer = null;
}
public static void main(String[] args) {
beep(Integer.parseInt(args[0]),Integer.parseInt(args[1]),Integer.parseInt(args[2]),Integer.parseInt(args[3]),0);
System.exit(0);
}
}