From fbd8962b14b0a9b62c664710c826455c0fef79bc Mon Sep 17 00:00:00 2001 From: Matt Kohls Date: Sun, 22 Dec 2019 01:41:48 -0500 Subject: Sound plays again and preemptive user sound dir fix I was being too proactive about checking for a null condition, so the AudioPlayerSendHandler wasn't able to grab the data correctly. Also now check for the directory the user supplies for usersound existing and that it is a directory before populating files from it. --- src/main/java/soundchan/AudioPlayerSendHandler.java | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'src/main/java/soundchan/AudioPlayerSendHandler.java') diff --git a/src/main/java/soundchan/AudioPlayerSendHandler.java b/src/main/java/soundchan/AudioPlayerSendHandler.java index fdd9774..43b1c75 100644 --- a/src/main/java/soundchan/AudioPlayerSendHandler.java +++ b/src/main/java/soundchan/AudioPlayerSendHandler.java @@ -24,19 +24,12 @@ public class AudioPlayerSendHandler implements AudioSendHandler { @Override public boolean canProvide() { - if (lastFrame == null) { - lastFrame = audioPlayer.provide(); - } - + lastFrame = audioPlayer.provide(); return lastFrame != null; } @Override public ByteBuffer provide20MsAudio() { - if (lastFrame == null) { - lastFrame = audioPlayer.provide(); - } - return ByteBuffer.wrap(lastFrame.getData()); } -- cgit v1.2.3