Commit Graph
24 Commits
Author SHA1 Message Date
Earle F. Philhower, III e11da8c325 MIDI + Soundfont wavetable synthesis capability
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.
2017-10-29 17:43:00 -07:00
Earle F. Philhower, III bf4f3d3257 Add double buffer and FastROMFS classes
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.
2017-10-27 21:14:14 -07:00
Earle F. Philhower, III c5da8c3062 Add timeout and HTTP size to streamer EOF checks
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.
2017-10-22 10:04:19 -07:00
Earle F. Philhower, III 2dac08ef4e Fix mono MP3 decoding causing choppy output
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.
2017-10-21 21:15:59 -07:00
Earle F. Philhower, III 047fef2678 Add SPIFFS file output option
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.
2017-10-05 19:04:40 -07:00
Earle F. Philhower, III 199e00d73a Update the library descriptions properly. 2017-10-02 11:09:20 -07:00
Earle F. Philhower, III 7b89388008 Minor note about WEMOS SD card shield 2017-09-29 06:58:03 -07:00
Earle F. Philhower, III ddb47b29c1 Explicitly call out path to config.h
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.
2017-09-28 12:01:41 -07:00
Earle F. Philhower, III cf0d5f298e Add classes to syntax hilighter 2017-09-06 12:12:22 -07:00
Earle F. Philhower, III 92120b317a Add shifting for 24- and 32-bit audio output
Right-shift appropriate # of bits for the higher bit depths.
2017-08-18 13:44:23 -07:00
Earle F. Philhower, III d0411c8b6e Add -O3 optimization to all C files
Arduino normally builds with -Os (optimize for size). For audio decode
we'd rather go fast, so add pragma inside files.
2017-08-18 13:10:53 -07:00
Earle F. Philhower, III d436a4ba7b Clean up headers and remove unneeded source files
Remove STDIO/FILE references from code and headers.  Remove any header
files not needed to support stread_decoder playback.
2017-08-18 13:07:23 -07:00
Earle F. Philhower, III c8af3b5d7b Fix header paths to not need symlinks
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.
2017-08-18 11:50:42 -07:00
Earle F. Philhower, III 443979673f Add SD card file input class 2017-08-18 08:18:22 -07:00
Earle F. Philhower, III 685dcbf18d Add FLAC support to the framework via libflac-1.3.2
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.
2017-08-17 18:25:04 -07:00
Earle F. Philhower, III 0a453a077a Warning and static removal
Clean up compiler warnings and make static variables in class functions
into class variables where they belong.
2017-08-15 20:58:16 -07:00
Earle F. Philhower, III 64ceb33a31 Add a HTTP streamer music "file" reader class
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.
2017-08-14 19:47:22 -07:00
Earle F. Philhower, III 4985aab58c Fix the schematic to remove overlaps 2017-08-12 10:39:29 -07:00
Earle F. Philhower, III cb6f530577 Update README with class information 2017-08-12 10:06:04 -07:00
Earle F. Philhower, III 3844fcb547 Add more info on speaker driver power 2017-08-12 09:35:32 -07:00
Earle F. Philhower, III 65519bd21e Add MOD sample code 2017-08-12 09:29:56 -07:00
Earle F. Philhower, III 6466df23f3 Add WAV and PROGMEM example 2017-08-12 09:20:09 -07:00
Earle F. Philhower, III 2cf8fcef2a Bring in files from original projects
The library was originally part of several separate projects.  Make the
needed structure and bring those files in, including some READMEs.
2017-08-12 09:01:42 -07:00
Earle F. Philhower, III 73ffc4cd95 Initial commit 2017-08-12 07:47:25 -07:00