MidiChannel sound trouble shooting
I am trying to play midi notes on my computer. My friend downloaded the code pasted here, and it plays notes on his laptop and his PC fine... When I try on my laptop it does not play any music.
Things I HAVE tried:
-Computer does play midi files I have tested it using winamp.
-Midi is NOT muted
-Volume IS turned on
-Volume IS turned up
The code I've used is as follows:
import javax.sound.midi.MidiChannel;
import javax.sound.midi.Synthesizer;
import javax.sound.midi.MidiSystem;
import javax.sound.midi.MidiUnavailableException;
public class Channel {
private MidiChannel channel;
public Channel() {
try {
Synthesizer synth =
MidiSystem.getSynthesizer();
synth.open();
channel = synth.getChannels()[0];
} catch (MidiUnavailableException e) {
e.printStackTrace();
}
}
public void playNote(int note) {
channel.noteOn(note, 70);
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
channel.noteOff(note, 70);
}
public static void main(String[] args) {
new Channel().playNote(100);
}
}

