From 95df1ee72049b6ee412c4d18fab35ff427979dce Mon Sep 17 00:00:00 2001 From: James Ball Date: Thu, 27 May 2021 16:11:43 +0100 Subject: [PATCH] Generalise Audio API but use SYSTEM_AUDIO --- pom.xml | 2 +- src/main/java/sh/ball/audio/AudioPlayer.java | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 6f2a91d5..40c8fb36 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ sh.ball osci-render - 1.6.2 + 1.6.3 osci-render diff --git a/src/main/java/sh/ball/audio/AudioPlayer.java b/src/main/java/sh/ball/audio/AudioPlayer.java index 6b51be61..07176ad9 100644 --- a/src/main/java/sh/ball/audio/AudioPlayer.java +++ b/src/main/java/sh/ball/audio/AudioPlayer.java @@ -35,7 +35,6 @@ public class AudioPlayer implements Renderer, AudioInputStream> { private static final int BITS_PER_SAMPLE = 16; private static final boolean SIGNED = true; private static final boolean BIG_ENDIAN = false; - private static final boolean WINDOWS = System.getProperty("os.name").startsWith("Windows"); private final XtFormat format; private final BlockingQueue> frameQueue = new ArrayBlockingQueue<>(BUFFER_SIZE); @@ -163,7 +162,7 @@ public class AudioPlayer implements Renderer, AudioInputStream> { } try (XtPlatform platform = XtAudio.init(null, null)) { - XtSystem system = WINDOWS ? XtSystem.WASAPI : platform.setupToSystem(XtSetup.CONSUMER_AUDIO); + XtSystem system = platform.setupToSystem(XtSetup.SYSTEM_AUDIO); XtService service = platform.getService(system); if (service == null) return;