AudioGeneratorMIDI plays a .MID file using any Soundfont2 wavetable
synthesis file. This is a highly hacked combination of TinySoundFont
and MIDITONES, and requires the FastROMFS to run at real-time in most
cases.
AudioFileSourceFastROMFS connects with the new FastROMFS to enable
higher speed read from SPI flash for files. Requires
https://github.com/earlephilhower/ESP8266FastROMFS to be installed.
AudioOutputBuffer implements a 2nd-level memory buffer for output
dat to hopefully allow playback w/o hiccups, but needs to be vetted.
Without being able to call it from an interrupt, not sure it can actually
improve output performance.
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.
Fixes issue #5 about choppy audio on low bitrate, mono MP3s.
The number of 32-sample elements to generate per MP3 data frame was
set to 36 as that was what I saw on all my source files. However, on
mono files only half the number of samples are to be generated and
you'd end up with the synthesizer bands running out of energy and
have periods of 0-samples between proper data.
Now simply check each decoded frame for the proper NSMAX value and
only generate that many. Tested on force.mp3 in the issue referenced.
AudioOutputSPIFFSWAV writes a valid WAV file to the SPIFFS filesystem.
Be sure to do a SPIFFS.start() or .format before calling any output.
Set the filename using the additional ->SetFilename() call.
Under Windows it seems that the Arduino compilation can't find
<config.h> from inside a subdirectory. So just point explicitly to
"../config.h" for includes in subdirs.
The FLAC makefile has additional -I include paths which let them use
files in other directories without path specifiers. Arduino doesn't
support this, so while my development system was using symlinks, this
would not work well under Windows. Instead, simply add proper path
specifiers to includes in other directories.
Ported libFLAC v1.3.2 to the ESP8266. Moved CRC constants to PROGMEM
and the error strings. Still to be done would be decreasing the output
buffer to an int16_t and moving a larce number of "const int" to enums
since "const int" eats 4 bytes per variable.
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.