Playing an AudioInputStream multiple times
I'm making a program that loads audio files and mix them together, producing an AudioInputStream object. I'd like to play the sound as many times as the user wants it, but I found that the AudioInputStream is emptied once is read, so I'm not able to replay it.
I solved the problem writing the content of the AudioInputStream into a temp file, and reading the file each time I want to play the sound. Is there any other better way to play an AudioInputStream more than once? Note that ais.markSupported() returns false, so I can't use reset().
If you need to see some code please ask me. Thanks in advance.