261 Commits
Author SHA1 Message Date
Martin-LaclaustraandMartin-Laclaustra 1c548c8846 Fixes for the ULP driver (#340)
* Fix the order of mono samples (each pair was swapped)

* Remove comment on version and date (currently tracked within ESP8266Audio repo)

* Added some usage instructions to the header file

* Delete sample in buffer after being rendered (ULP) to avoid sound looping in the buffer at the end of playback

Co-authored-by: Martin-Laclaustra <Martin-Laclaustra@github.com>
2020-11-23 12:30:56 -08:00
Pierre-Loup MandPierre-Loup Martin 2dc245ff2e Fix tags framesize endless loop, add add'l tag support (#336)
* Modified AudioFileSourceFS.h to add resolution operator on items defined into the fs namespace in esp32 libraries.

* Added track, set, popularimeter, compilation tags.
Changed framesize loop with 32bit counter to avoid endless loops for large frames (like APIC).

Co-authored-by: Pierre-Loup Martin <lelabodutroisieme@gmail.com>
2020-11-16 10:02:57 -08:00
Pierre-Loup MandPierre-Loup Martin 7f3908c239 Modified AudioFileSourceFS.h to add resolution operator on items defined into the fs namespace in esp32 libraries. (#335)
Co-authored-by: Pierre-Loup Martin <lelabodutroisieme@gmail.com>
2020-11-15 10:20:21 -08:00
Adamcbrz 299db3d03d Modify AudioOutputI2S to initialize i2s during begin (#331)
Fixes #330
2020-11-14 11:02:48 -08:00
Earle F. Philhower, III 1c7a2f7cb5 Add output via the ULP for the ESP32 (#326)
Code courtesy of Martin Laclaustra.

Uses the ULP coprocessor on the ESP32 to send samples to the onboard
DACs, freeing the I2S port for other uses.

Connect left output to pin 25, right to pin 26.
2020-11-01 14:02:59 -08:00
piebrain bbd8748f86 Reset errors and avoid memory leak (#321)
When reusing the AudioGeneratorMP3 object to play multiple files with errors, the error count was never reset.
Also, if 3 errors are encountered, it would stop running but never clean up the buffers.
2020-10-26 18:54:37 -07:00
Earle F. Philhower, III 90258c566a Fix HTTP redirects with latest releases on ESP8266 (#319) 2020-10-25 17:29:12 -07:00
david gauchard 2fb8d887b1 Fixes when seeking in an MP3 file (#303)
* separate malloc structures

* add desync() for user when randomly seeking in the input file
fix corner cases leading to exceptions when seeking

* additional test when trying to crash-shake everything
with a rotary encoder seeking into the currently played file

* use private instead of static

* remove temporary debug code
2020-09-06 11:41:45 -07:00
Earle F. Philhower, III 93a540da9b Add FLAC host test (#302) 2020-09-03 08:37:15 -07:00
david gauchard 1c51669729 test/run on host, output to null device (#299)
* test/run on host to null device

* compilation fix
2020-08-30 15:07:11 -07:00
Gianni Ceccarelli 96d036087b Fix memory loading (#300) 2020-08-28 12:51:12 -07:00
Earle F. Philhower, III cdf71d6bcf Fix AAC mono decode (#297)
As noted by Marc Madaule (thanks!), the mono AAC decode was not
functioning properly.  Adjust the output stuff loop to fix.
2020-08-15 21:05:12 -07:00
Earle F. Philhower, III 197b7fe794 Fix seek behavior in Opus, STDIO (#296) 2020-08-12 16:59:03 -07:00
Earle F. Philhower, III a0a06a9832 Reduce OpusFile RAM by only allowing mono/stereo (#295) 2020-08-11 22:04:41 -07:00
Earle F. Philhower, III fae26d4010 Add Opus file format (and OGG demux) (#294)
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
2020-08-11 20:56:13 -07:00
Earle F. Philhower, III 0266d9af14 Fix missed merge in MIDI notegen (#291)
Patch 21c07c0bcd702e7adf3db349ac926914b98d17ce was applied to the TSF's
original code, but not to the fixed-point generator used by the ESP8266.
Apply it to the FP unit as well.

Spotted by Marc Madaule
2020-08-09 19:08:56 -07:00
Earle F. Philhower, III 0d1d849f91 Fix factor-of-2-off MIDI velocity parsing (#290)
Velocity in the MIDI format goes from 1...127, so scale the volume of
the note generator by /128 instead of /256.   Increases volume of all
notes by 2x linearly (3dB).

Found by Marc Madaule
2020-08-09 19:01:16 -07:00
Earle F. Philhower, III 05839052fb Add FatFS file source (#289)
Thanks to Marc Madaule for the patch adding FatFS for the ESP32 as a
file source.
2020-08-09 11:21:45 -07:00
Earle F. Philhower, III 33494596a4 Fix OOB read on fast sample generation in MIDI
Valgrind identified cases where the chunk read position came out to be
-1, which was causing a read of memory before the actual cache buffers.
This could result in add'l noise on playback.
2020-08-07 21:49:39 -07:00
Earle F. Philhower, III fe21f08e99 Clear running state var in MIDI constructor 2020-08-07 21:32:32 -07:00
Earle F. Philhower, III 7bb251102e Only follow HTTP redirects on ESP8266
ESP32 doesn't have the redirect following capability, don't try and turn it on.
2020-07-29 07:48:27 -07:00
jaenek a1737e7842 Follow redirects (#276) 2020-07-28 17:18:01 -07:00
Felix Eckhardt e59319f605 added missing DMA buffer flush, see issue #270 for details (#271) 2020-05-21 13:16:34 -07:00
Earle F. Philhower, III e0d413622c Add Talkie (TI speech synthesizer) support (#269)
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.
2020-05-13 20:16:48 -07:00
Earle F. Philhower, III b7cb0ee8e2 Redo the last packet handling of the MP3 decoder (#266)
Keep track of how many values are actually good in the buffer (before it
was always guaranteed to be the full size) and when EOF is detected,
only shift out valid, good bytes, and return STOP when the unused bytes
are 0 or unchanged from the last pass.

Fixes #265
2020-05-11 02:09:05 -07:00
geoffday67 1fde10daa0 Wait after reading MP3 file for final frames (#263) 2020-04-26 10:07:13 -07:00
david gauchard 1ca965b474 (WIP) updates for c++17 - opened for discussion (#249)
* updates for c++17

* picked upstream fix on Earle's advice
https://github.com/schellingb/TinySoundFont/blob/21c07c0bcd702e7adf3db349ac926914b98d17ce/tsf.h#L829-L839
(simplified PR)

* remove `register`
2020-04-16 15:38:14 -07:00
Paul Andrews 34303ced6c Fix compilation error in new libflac/stream_decoder (#258) 2020-04-16 07:22:31 -07:00
Earle F. Philhower, III a4fd448143 Fix compile warnings 2020-04-15 20:37:11 -07:00
Earle F. Philhower, III 2581b82773 Update to latest FLAC sources (7a35c5284) (#256)
Merge the upstream changes to the FLAC library up to commit
7a35c528495b6d8a51e87e007f6810b5553101bc.

Shouldn't have any real impact to existing code.

Tested with the example and runs well.
2020-04-15 14:13:11 -07:00
Earle F. Philhower, III 41f70f9fd2 Merge branch 'master' of https://github.com/earlephilhower/ESP8266Audio 2020-04-15 11:35:13 -07:00
Earle F. Philhower, III 29c3f37680 Actually git add AudioFileSourceLittleFS.h
D'oh!
2020-04-15 11:34:47 -07:00
Earle F. Philhower, III 3dd872f615 Update to latest TinySoundFont (#255)
LibTinySoundFont has been modified significantly since I forked
it to do the ESP8266 edits. Update to latest merges.

Tested using the LittleFS MIDI example and seems to work well.
2020-04-15 11:28:37 -07:00
Earle F. Philhower, III 5b8ba1681c Fix ESP32 compilation, add SPI class RAM wrapper (#254)
Seems like VSCODE and others try and compile all files in a directory,
even if they aren't used.  Because the spiram-fast had ESP8266-only
registers, it caused an error when attempting to build anything for the
ESP32.

Update by writing a new SPI class based version of the spiram-fast class
(tested on the ESP8266) which uses the SPI wrapper class.

Fixes #253
2020-04-15 10:01:24 -07:00
Earle F. Philhower, III 0fd2d0413b Replace external SPIRAM lib w/internal optimized (#250)
* 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.
2020-04-14 15:41:47 -07:00
Earle F. Philhower, III be0ee8283f Free BCK and WS pins for general use with NoDAC (#251)
The BCK and WS pins aren't needed or used when using the I2SNoDAC
option.  Restore their settings to whatever they were before, leaving
them untouched.  Apps may configure the additional pins either before or
after the I2SNoDac is created.
2020-04-14 11:49:12 -07:00
Ivan Kostoski 9e90cd780e Fix compile error on ESP32 (#241) 2020-02-28 13:37:55 -08:00
Ivan Kostoski 377b271edd ESP8266 SinglePinI2SDriver, SPDIF output improvements, FLAC memory optimization (#237)
* Added S/PDIF output using I2S peripheral

* Added AudioOutputSPDIF to README and PROGMEM changes

* SPDIF/I2S sample rate fixes

* Fix SPDIF example file name

* Minimal (single pin) I2S driver

* AudioOutputSPDIF changes for minimal I2S driver

* Documentation changes

* FLAC decoding memory optimization
2020-02-24 09:55:30 -08:00
Ivan Kostoski a7a8b917d2 Added S/PDIF output using I2S peripheral (#235)
* Added S/PDIF output using I2S peripheral

* Added AudioOutputSPDIF to README and PROGMEM changes
2020-02-07 13:05:03 -08:00
Christian Ferbar 074dfd47b0 Allow playing wav files via HTTPStream (#224)
* ReadWAVInfo(): print error message if seek() fails

* AudioFileSourceHTTPStream::seek() print error message - not implemented

* AudioFileSourceBuffer::seek if SEEK_CUR and seek_len < writePtr keep the buffer (fix for HTTPStream)

* Update AudioFileSourceBuffer.cpp
2019-11-24 08:52:50 -07:00
david gauchard 4fed6a230f install and use a global audioLogger instead of Serial (#198)
* use of global audioLogger-> instead of Serial.

* default to silence

* initialize logger in examples
2019-07-24 10:02:21 -07:00
philippe44 598163dd59 AAC endianness (#191) 2019-06-20 15:38:32 -07:00
bootrino abee116aa2 Added failure messages to ReadWAVInfo, also handled JUNK in WAV (#171)
* Modified ReadWAVInfo method to give meaingful messages to Serial when it cannot read a WAV file, and also added code to handle WAV files that contain JUNK data, which is a valid part of the WAV specification.

* Added error messages to ReadWAVInfo function using Serial.printf_P(PSTR(
Added error messages to begin function using Serial.printf_P(PSTR(
Implemented skipping through JUNK (as defined in the WAV specification), if present in the WAV file.

* Added new lines to error messages in the "begin" function
2019-05-12 08:32:40 -07:00
Earle F. Philhower, III d0089c1f4a Fix ESP32 compile 2019-04-13 17:40:28 -07:00
Earle F. Philhower, III c075835c07 Re-add missing SPIFFS file source wrapper 2019-04-13 16:55:27 -07:00
Earle F. Philhower, III 65220b8e31 Add a AudioFileSourceFS object
Allow passing in SDFS, LittleFS, or SPIFFS to access files for the audio
playback.
2019-04-13 16:09:21 -07:00
Earle F. Philhower, III 22b52e0ed5 Fix MOD clipping, bad output
MODs were saturating because the audio was being scaled 2x too high for
output.  Simple fix dramatically increases quality of sample output.
2019-04-13 13:31:41 -07:00
Earle F. Philhower, III a781eef59c Rewrite ICY metadata parser to be faster
The ICY metadata parsing was very slow because of bytewise reading from
web stream.  Use a more convoluted, but faster, chunked method.
2019-04-12 20:29:48 -07:00
h3ndrik 2c5ae5d490 don't try to read 0 bytes if we hit the icy block (fixes #124) (#125)
* don't try to read 0 bytes if we hit the icy block

* make sure size isn't negative
2019-04-12 16:21:00 -07:00
Maigre 87fbcadd80 Call output->stop() when stopping generators (#174)
* Fix hanging sound on WAV stop for ESP32

* Fix hanging sound on AAC stop for ESP32

* Fix hanging sound on MIDI stop for ESP32

* Fix hanging sound on MOD stop for ESP32

* Fix hanging sound on MP3a stop for ESP32

* Fix hanging sound on RTTTL stop for ESP32
2019-04-12 16:17:10 -07:00