In JDK8, I can't seem to get any useful data out of the AudioInputStream created by a SoftSynthesizer.
AudioSynthesizer s = new SoftSynthesizer();
AudioFormat format = new AudioFormat(44100, 16, 2, true, false);
AudioInputStream stream = s.openStream(format, null);
s.getChannels()[0].noteOn(60, 100);
while (stream.available() >= 0) {
byte[] b = new byte[2];
stream.read(b);
System.out.println(b[0] << 8 | b[1]);
}
s.getChannels()[0].noteOff(60);
However, println() only shows 0, there is no audio data coming out from the AudioInputStream. Am I doing something wrong? Or is Gervill deprecated as of JDK 8?