From c059ebf933ae4c6eeb26da50e168db2322e4790f Mon Sep 17 00:00:00 2001 From: Santiago Seifert Date: Thu, 4 Aug 2022 19:54:06 +0100 Subject: Remove LOGGER references and a '== Double.NaN' check (#113) LOGGER is not imported, and Double.NaN doesn't follow traditional '==' comparison rules. --- android/com/jsyn/devices/android/AndroidAudioForJSyn.java | 4 ++-- src/main/java/com/jsyn/io/AudioFifo.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/android/com/jsyn/devices/android/AndroidAudioForJSyn.java b/android/com/jsyn/devices/android/AndroidAudioForJSyn.java index 20bbb68..2d17b0c 100644 --- a/android/com/jsyn/devices/android/AndroidAudioForJSyn.java +++ b/android/com/jsyn/devices/android/AndroidAudioForJSyn.java @@ -84,9 +84,9 @@ public class AndroidAudioForJSyn implements AudioDeviceManager { minBufferSize = AudioTrack.getMinBufferSize(frameRate, AudioFormat.CHANNEL_OUT_STEREO, AudioFormat.ENCODING_PCM_FLOAT); - LOGGER.debug("Audio minBufferSize = " + minBufferSize); + // LOGGER.debug("Audio minBufferSize = " + minBufferSize); bufferSize = (3 * (minBufferSize / 2)) & ~3; - LOGGER.debug("Audio bufferSize = " + bufferSize); + // LOGGER.debug("Audio bufferSize = " + bufferSize); audioTrack = new AudioTrack(AudioManager.STREAM_MUSIC, frameRate, AudioFormat.CHANNEL_OUT_STEREO, AudioFormat.ENCODING_PCM_FLOAT, bufferSize, diff --git a/src/main/java/com/jsyn/io/AudioFifo.java b/src/main/java/com/jsyn/io/AudioFifo.java index b7321c6..5a87643 100644 --- a/src/main/java/com/jsyn/io/AudioFifo.java +++ b/src/main/java/com/jsyn/io/AudioFifo.java @@ -173,7 +173,7 @@ public class AudioFifo implements AudioInputStream, AudioOutputStream { int numRead = 0; for (int i = 0; mOpen && i < count; i++) { double value = read(); - if (value == Double.NaN) break; + if (Double.isNaN(value)) break; buffer[i + start] = value; numRead++; } -- cgit v1.2.3