mirror of
https://github.com/moonlight-stream/moonlight-embedded.git
synced 2026-10-23 08:30:44 +00:00
Try to workaround Java's poor OS X mixer
This commit is contained in:
1 parent
2d346d4128
commit
03b6abe694
1 file changed
+9
-1
@@ -48,7 +48,15 @@ public class JavaxAudioRenderer implements AudioRenderer {
|
||||
DataLine.Info info = new DataLine.Info(SourceDataLine.class, audioFormat);
|
||||
try {
|
||||
soundLine = (SourceDataLine) AudioSystem.getLine(info);
|
||||
soundLine.open(audioFormat);
|
||||
|
||||
// Java's OS X mixer performs very badly with the default buffer size
|
||||
if (System.getProperty("os.name").contains("Mac OS X")) {
|
||||
soundLine.open(audioFormat, 16384);
|
||||
}
|
||||
else {
|
||||
soundLine.open(audioFormat);
|
||||
}
|
||||
|
||||
soundLine.start();
|
||||
|
||||
lineBuffer = new byte[soundLine.getBufferSize()];
|
||||
|
||||
Reference in new issue
Block a user