this seems to have fixed the audio latency, need to check on other systems

I read that OSX requires the larges buffer size so this should be plenty for other systems as well. However, I did notice
that making the buffer any larger caused a negative effect in terms of latency.
This commit is contained in:
Diego Waxemberg
2013-12-13 00:22:35 -05:00
parent ed1a0981f1
commit 5499c2cea5

View File

@@ -34,10 +34,10 @@ public class JavaxAudioRenderer implements AudioRenderer {
@Override
public void streamInitialized(int channelCount, int sampleRate) {
AudioFormat audioFormat = new AudioFormat(sampleRate, 16, channelCount, true, true);
DataLine.Info info = new DataLine.Info(SourceDataLine.class, audioFormat, OpusDecoder.getMaxOutputShorts()*8);
DataLine.Info info = new DataLine.Info(SourceDataLine.class, audioFormat, OpusDecoder.getMaxOutputShorts());
try {
soundLine = (SourceDataLine) AudioSystem.getLine(info);
soundLine.open(audioFormat);
soundLine.open(audioFormat, 131072);
soundLine.start();
} catch (LineUnavailableException e) {
soundLine = null;