aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/com/jsyn/devices/javasound/JavaSoundAudioDevice.java
diff options
context:
space:
mode:
authorPhil Burk <[email protected]>2021-09-01 20:20:27 -0700
committerPhil Burk <[email protected]>2021-09-01 20:23:51 -0700
commitd33fb2c959fff6471dc48434b37b01ac98874e82 (patch)
tree9844c2762853cd3a22c59093d0f25484a7d202cb /src/main/java/com/jsyn/devices/javasound/JavaSoundAudioDevice.java
parent911c8c9f292374b1668ce5e30a539f7e62f75369 (diff)
jsyn: remove dependency on SLF4J
It was causing too many problems and had no apparent benefit. Fixes #101
Diffstat (limited to 'src/main/java/com/jsyn/devices/javasound/JavaSoundAudioDevice.java')
-rw-r--r--src/main/java/com/jsyn/devices/javasound/JavaSoundAudioDevice.java18
1 files changed, 4 insertions, 14 deletions
diff --git a/src/main/java/com/jsyn/devices/javasound/JavaSoundAudioDevice.java b/src/main/java/com/jsyn/devices/javasound/JavaSoundAudioDevice.java
index 75c4a8a..1a63b32 100644
--- a/src/main/java/com/jsyn/devices/javasound/JavaSoundAudioDevice.java
+++ b/src/main/java/com/jsyn/devices/javasound/JavaSoundAudioDevice.java
@@ -30,8 +30,6 @@ import javax.sound.sampled.TargetDataLine;
import com.jsyn.devices.AudioDeviceInputStream;
import com.jsyn.devices.AudioDeviceManager;
import com.jsyn.devices.AudioDeviceOutputStream;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
/**
* Use JavaSound to access the audio hardware.
@@ -40,8 +38,6 @@ import org.slf4j.LoggerFactory;
*/
public class JavaSoundAudioDevice implements AudioDeviceManager {
- private static final Logger LOGGER = LoggerFactory.getLogger(JavaSoundAudioDevice.class);
-
private static final int BYTES_PER_SAMPLE = 2;
private static final boolean USE_BIG_ENDIAN = false;
@@ -55,17 +51,15 @@ public class JavaSoundAudioDevice implements AudioDeviceManager {
String osName = System.getProperty("os.name");
if (osName.contains("Windows")) {
suggestedOutputLatency = 0.08;
- LOGGER.info("JSyn: default output latency set to "
- + ((int) (suggestedOutputLatency * 1000)) + " msec for " + osName);
}
deviceRecords = new ArrayList<DeviceInfo>();
sniffAvailableMixers();
- dumpAvailableMixers();
+ if (false) dumpAvailableMixers();
}
private void dumpAvailableMixers() {
for (DeviceInfo deviceInfo : deviceRecords) {
- LOGGER.debug("" + deviceInfo);
+ System.out.println("" + deviceInfo);
}
}
@@ -177,14 +171,12 @@ public class JavaSoundAudioDevice implements AudioDeviceManager {
public void start() {
DataLine.Info info = new DataLine.Info(SourceDataLine.class, format);
if (!AudioSystem.isLineSupported(info)) {
- // Handle the error.
- LOGGER.error("JavaSoundOutputStream - not supported." + format);
+ // TODO Handle the error.
} else {
try {
line = (SourceDataLine) getDataLine(info);
int bufferSize = calculateBufferSize(suggestedOutputLatency);
line.open(format, bufferSize);
- LOGGER.debug("Output buffer size = " + bufferSize + " bytes.");
line.start();
} catch (Exception e) {
@@ -273,14 +265,12 @@ public class JavaSoundAudioDevice implements AudioDeviceManager {
public void start() {
DataLine.Info info = new DataLine.Info(TargetDataLine.class, format);
if (!AudioSystem.isLineSupported(info)) {
- // Handle the error.
- LOGGER.error("JavaSoundInputStream - not supported." + format);
+ // TODO Handle the error.
} else {
try {
line = (TargetDataLine) getDataLine(info);
int bufferSize = calculateBufferSize(suggestedInputLatency);
line.open(format, bufferSize);
- LOGGER.debug("Input buffer size = " + bufferSize + " bytes.");
line.start();
} catch (Exception e) {
e.printStackTrace();