@Test void testGetAudioStream() throws InterruptedException, IOException { byte[] in = new byte[getFormat().getFrameSize() * 100]; byte[] out = new byte[in.length]; fillBuffer(in); BasicSoundPlayer player = new BasicSoundPlayer(in, getFormat(), 1); try (AudioInputStream ais = player.getAudioStream()) { player.start(); int amount = readAll(out, ais); Assertions.assertEquals(in.length, amount, "Wrong number of bytes"); Assertions.assertArrayEquals(in, out, "Wrong data."); } }
@Override public AudioInputStream getAudioStream() { return this.audioStream; }
BasicSoundPlayer implements Runnable, SoundPlayer { @Override public AudioInputStream getAudioStream() { return this.audioStream; } }
BasicSoundPlayer implements Runnable, SoundPlayer { @Override public AudioInputStream getAudioStream() { return this.audioStream; } protected  BasicSoundPlayer(byte[] audioData, AudioFormat format, int loopCount); }
BasicSoundPlayer implements Runnable, SoundPlayer { @Override public AudioInputStream getAudioStream() { return this.audioStream; } protected  BasicSoundPlayer(byte[] audioData, AudioFormat format, int loopCount); @Override AudioInputStream getAudioStream(); @Override void run(); @Override void start(); @Override void stop(); @Override boolean isRunning(); @Override void setOnStopHook(Consumer<StopReason> callback); }
BasicSoundPlayer implements Runnable, SoundPlayer { @Override public AudioInputStream getAudioStream() { return this.audioStream; } protected  BasicSoundPlayer(byte[] audioData, AudioFormat format, int loopCount); @Override AudioInputStream getAudioStream(); @Override void run(); @Override void start(); @Override void stop(); @Override boolean isRunning(); @Override void setOnStopHook(Consumer<StopReason> callback);  }