So, I have an AudioInputStream
, which reads from a FileInputStream
. I want to close the FileInputStream
which will close the AudioInputStream
.
Is there any way to load the audio completely, so that I don't have to stream it directly from the file?
You can store it in a Java Clip
.
Example:
Clip clip = AudioSystem.getClip();
clip.open(/*your AudioInputStream*/);
Make clip a field, to use it later.