I’m creating an app which needs to play audio file (mp3, wav, aiff etc) from local file-system as well as from web. It works fine for local file-system on Windows and Mac. However, when I’m feeding an InputStream from a url (through URL::createInputStream & AudioFormatManager::createReaderFor), its getting hanged, or, sometimes responses the UI and playing after a long time (rarely) and sometimes not (most of the time).
So what I’m doing for now is downloading the content from web and keeping in memory-stream and feeding that stream when downloading is done.
What I want is the player will play audio from web with buffering (will be able to play the amount already downloaded and while the remaining content is downloading).
The class has been around since March, looking at the git logs… No idea what version JUCE was at that point, but seems like a chance to update your instance of the repository (JUCE is at 2.0.40 now).
Yeah, I found that file after git cloning, thanks. But how that class can help to solve my problem? That class also takes an AudioFormatReader instance in the constructor and the hanging happens when I call AudioFormatManager::createReaderFor(InputStream*) method to create that AudioFormatReader instance?
How big are the files you need to play? I looked at those classes with the same purpose in mind a few months ago and wasn’t able to get it to work, but I only needed to play 30 second audio samples. So, I just downloaded the files to the local harddrive first rather than streaming them off the web, and that worked fine.