mirror of
https://github.com/moonlight-stream/moonlight-embedded.git
synced 2026-06-15 21:31:12 +00:00
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:
@@ -34,10 +34,10 @@ public class JavaxAudioRenderer implements AudioRenderer {
|
|||||||
@Override
|
@Override
|
||||||
public void streamInitialized(int channelCount, int sampleRate) {
|
public void streamInitialized(int channelCount, int sampleRate) {
|
||||||
AudioFormat audioFormat = new AudioFormat(sampleRate, 16, channelCount, true, true);
|
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 {
|
try {
|
||||||
soundLine = (SourceDataLine) AudioSystem.getLine(info);
|
soundLine = (SourceDataLine) AudioSystem.getLine(info);
|
||||||
soundLine.open(audioFormat);
|
soundLine.open(audioFormat, 131072);
|
||||||
soundLine.start();
|
soundLine.start();
|
||||||
} catch (LineUnavailableException e) {
|
} catch (LineUnavailableException e) {
|
||||||
soundLine = null;
|
soundLine = null;
|
||||||
|
|||||||
Reference in New Issue
Block a user