/** * Plays a sound with an optional SoundFilter, and optionally looping. This method returns * immediately. */ public InputStream play(Sound sound, SoundFilter filter, boolean loop) { InputStream is; if (sound != null) { if (loop) { is = new LoopingByteInputStream(sound.getSamples()); } else { is = new ByteArrayInputStream(sound.getSamples()); } return play(is, filter); } return null; }