I'm creating a program which mathematically generates byte arrays that are interpreted into sound, and to make them all play at the same rate and begin on the same sample, I need to use the Mixer
interface from java.sound.sampled
, and more specifically, the synchronize(line[], boolean maintainSync)
. I have it set as:
Mixer a = (Mixer) new Object();
a.synchronize(lines, false);
lines[0].start();
I know this code doesn't work, but neither does implementing the interface into my class and trying to refer to the method through this.synchronize(----)
but the class needs to become abstract
in order to implement it due to a line.getInfo
function. I don't know how to use the synchronize()
method without encountering a problem or making the function actually work.