Java sound: line.write() returns 0
I'm trying to play a sine wave.
I have a SourceDataLine, but when I try to write to it, the write method return 0, meaning that it coulen't write anything to the mixer's output stream, right? I also don't get to hear a thing, by the way. Here's the code I'm using: Code:
byte [] sample = new byte[4]; The Audio Format is PCM_SIGNED, at 44.1 KHtz, 16 bits per sample, Stereo, little endian. Any ideas? |
I will refrase the problem:
How can I get a SourceDataLine I could use to hear a wave? Im doing this, but I don't get a single line that works: Code:
AudioFormat format = new AudioFormat(44100f, 16, 2, true, false); |
All times are GMT -5. The time now is 01:57 AM. |