Add a subclass of the HTTPStream that can extract the ICY metadata.
Needs to implement a callback function or parse it internally and expose
a class variable to let the UI see the current stream information.
The buffer class seems to work very well to avoid hiccups while
streaming from the web, so add it by default to the example to
make it easier for users to cut-n-paste and make it work.
AudioFileSourceBuffer allows system RAM to be used to buffer an
input file (normally just a HTTP Stream) to help avoid hiccups.
This could also be subclassed to use an external SRAM, at some
soint.
HTTPStreamer assumed the server would drop the connection when no more
data was available to be transferred from the source file.
For individual files, though, the web server will send the expected length
in the headers and leave the connection open (i.e. to recycle the connection
and accelerate web browsing). In this case, the streamer would effectively
hang waiting for more data than was being transmitted.
Now check the read data against the expected data, and also add a 0.5s
timeout no matter what to the reading.
Tested on streaming and served files, seems to work fine.
Implements a simple and stupid HTTP stream reader to allow for ShoutCast
and other MP3 radio streaming to happen. Presently seems to stutter on
128K, 44.1KHz streams, but may be better on lower bitrates.