mfsampledsp icon indicating copy to clipboard operation
mfsampledsp copied to clipboard

Play from memory

Open alexandre-goretti opened this issue 9 years ago • 1 comments

I need to play a MP3 that comes from a byte[].

I got an error when I tryed that:

javax.sound.sampled.UnsupportedAudioFileException: could not get audio input stream from input stream

alexandre-goretti avatar Sep 09 '15 22:09 alexandre-goretti

I assume you wrap the byte array into a ByteArrayInputStream? Decoding from arbitrary streams is currently not supported. Try dumping the byte array to a file with the extension .mp3 and then open that using AudioSystem.

hendriks73 avatar Sep 10 '15 06:09 hendriks73