* Pull untouched upstream TinySoundFont
Start from the upstream TinySoundFont by @schellingb at
https://github.com/schellingb/TinySoundFont and rearchitect the MIDI
processing.
* Convert to PROGMEM-based SoundFont structures.
This makes it much faster to access the SoundFont and also removes all the
static RAM usage. The samples, the regions, the instruments are all now
in ROM. Only the dynamic voices and related info takes up RAM. No caching.
* (Re)convert to fixed point math.
TSF upstream is built for systems with real floating point units (and
produces great sound with it!), but processors like the Pico, ESP8266,
and several models of ESP32 don't have one so emulate FP in *extremely*
slow SW. Use fixed point (integer) representations for the inner loop
and wherever possible to avoid `float` math.
For processors like the Pico 2 or original ESP32 with hardware FPUs this
still increases performance since integer is still much faster.
* Redo the example and add default SF2s
Rewrite the MIDI examples to use PROGMEM for both SF2 and MID file.
It simplifies life for the casual user and me.
* Breaking change
The MIDI object now has a `midi::SetSoundFont(tsf *)` instead of a
`midi::SetSoundfont(AudioFileSource *)`. It no longer supports reading
SF2 from LittleFS or SD.
Move to the new I2S driver for the ESP chips, since the next revisioncl
of the IDF will remove them completely.
Make the I2S constructors saner and add consistent SetPinout() and
SetBuffers calls to allow configuration.
Remove need for separate UseMCLK or SwapClocks calls, we can figure
that out from the pins selected.
Fixes#758
Move to Opus 1.5.1
Remove OpusFile and OGG libraries because we parse the OGG file in
the object directly with way less memory and overhead.
Update example for LittleFS and RP2040
Fixes#372
MP3 comes in chunks of encoded data started by a header sequence.
Scan for it in the decoder and only pass in data that starts with
this header to avoid the burst errors
Avoids a avalanche of `lost synchronization` error reports when there
is a file error.
Also enable additional sketches on the RP2040/RP2350
Implement the renamed network client and other API changes when built
under the 3.x branch of the Arduino ESP32 core.
Disable building TSF on the ESP32, the Xtensa G++ backend bug is still there.
Minimal changes to get I2S to build under new IDF. Deprecated but
not removed, so warnings are expected but should not be fatal in
use.
Fixes#683
Fix examples to build on RP2040
Clean up generator warnings
No SPDIF on RP2040 (yet)
Add back C sources for AAC on ARM
No WiFi streaming on RP2040
No webradio on RP2040
No talking clock (NTP) on RP2040 either
Without this fix, there is no sound and the serial monitor shows:
Starting up...
[E][vfs_api.cpp:22] open(): File system is not mounted
[E][vfs_api.cpp:22] open(): File system is not mounted
BEGIN...
MIDI done
MIDI done
After this fix there is sound and no error on the serial monitor.
Then change is similar to the code in https://github.com/earlephilhower/ESP8266Audio/blob/master/examples/PlayMP3FromSPIFFS/PlayMP3FromSPIFFS.ino
* replace a disappeared shoutcast url by a working one from another example
* increase a buffer size (found by valgrind)
* make emulated example closer to the not emulated one
use `./onHost diff` to show the diff -u
* add `diff` option to onHost script
* add a delay to local copy of AudioOutputNull
* increase another buffer size
* make AudioOutputNullSlow.h compatible with arduino api (not only emulation on host)
Add ported versions of the Opus codec, OpusFile parser, and OGG demuxer
from Xiph.org.
Only works on the ESP32 due to memory limitations (of opusfile,
strangely enough, and not because of opus compression).
Adds a basic example and a host test.
Fixes#278
Rewrite https://github.com/going-digital/Talkie to work in the
ESP8266Audio framework. Allows sync and async speech.
Add a very annoying talking clock example.
LittleFS reads many times faster than SPIFFS, and is now in the ESP8266,
so include a file source for it and move the MIDI example to LittleFS.
Keep the SPIFFS as ESP32 doesn't support LittleFS yet.
* Replace external SPIRAM lib w/internal optimized
Instead of requiring everyone to download and install another Arduino
library to use this lib, include an optimized, self-contained one from
the 8266 VM PR: https://github.com/esp8266/Arduino/pull/6994
Does change the API as it now requires a HW chip select, so that
parameter is removed from the SpiRAM buffer object.
* Redo the FIFO to try and be faster
* Fix the SPI interface, buffering.
SPI FIFO needs special care so do all work in a RAM copy and the copy it
over manually w/32b writes.
Ensure the SPI command is done before touching the FIFO.
Fix buffering organization.
Make the buffer report status as a #### bar.
* Fix infinite wait on EOF
* Add SW chip select support
* Update URL to one that's live today
* Clean up metadata printout
* Clean up readme refs to obsolete lib
* Slow down the DIO->SIO reset sequence
* Update readme to remove old SPIRam library ref
Also add the resistor to the 1T circuit to avoid transistor overheating.
Seems like I2S DACs don't like to be presented with perfect bang-bang
square waveforms, so build a very simple model and use that to avoid
abrupt changes in values. Sounds about as good as you're going to get
with this.
Also add a simple example showing how to play a RTTTL string.
With the multiple I2S modes on the ESP32, it makes sense to use a
cleaner class hierarchy for the I2S tools. Make I2SNoDAC into a
subclass of I2S (renamed from I2SDAC) and remove about 80% of the
code which was identical exept for the per-sample bitstream synthesis.
To avoid allocations in the application, preallocate all decoder and
buffer memory in and then never free it. Use the new pre-alloc'd
constructors to generate the playback objects.
Enable automatic building of all examples and SAM(speech) on a
commit by using Travis-CI. Build against ESP8266 and ESP32.
Minor tweaks to examples and codebase to allow successful compilation
on ESP32 compiler.
The examples were setting a hostname for the WiFi connection, but this is
done via a different call on the ESP32 vs. the ESP8266. To avoid #ifdef
explosion, simply remove the call as it's unneeded anyway.
Thanks to @reaper7 for reporting this in pull #33.
The web interface has a hardcoded 64 char URL limit, even though the
actual url[] array was increased to 96 chars. Use sizeof(url) in the
handler instead of a hardcoded number to enable use of all space.
Addresses issue #21 , again.
The MD and STATUS callbacks can be passed PROGMEM strings, so be sure to
use proper strcpy_p()s to move them to RAM before printing to avoid crashes.
Found during debug of issue #21 .
EEPROM saving was not calculating the correct checksum because it was
not clearing memory before writing. Fix that so it automatically will
restart the connection on a reset.
There was a fatal corruption caused by improper delete'ing of objects
without clearing their pointers when the initial connection to a stream
failed. Refactor to use the proper StopPlaying() routine.
Extend the URL to 96 characters. We not have enough memory to do so!