How to wrap an AudioFormatReader in a BufferingAudioReader


#1

Hey,

I’ve been trying to play a section of an InputStream as it loads, my approach thus far is to start the stream and pass it to a format reader. Then in a timer callback try to access and pull bits from the stream. Seems this method isn’t working.

What I’m now trying, and I’ve seen it asked a couple other times on the forum, is to wrap the reader in a BufferingAudioReader. This isn’t working either as the thread hangs on trying to create the first reader. I’ve also tried to create the BufferingAudioReader in the timerCallback() but to no avail.

Anyone had success playing bits of an inputStream as it loads? All the classes are there, so I’m sure the answer is right in front of me… Just a bit confused putting the pieces together.

also should mention my InputStream is wrapped in a buffered input stream, but calling the read functions of the bufferedStream in the timer callback were also causeing issues