The I2S outputs were converting samples in the buffer passed in
from u8->s16 on every call. When the I2S was full, however, the
sample would not get pushed and the output function would be
called at a later time with the same buffer...which was already
at 16 bits. It'd be converted again and turned into a high
frequency noise on the output.
Now only modify a copy of the input sample in I2S and I2SNoDAC.
Fixes the conversion problem competely.
Fixes#2
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.
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.
AAC-SBR allows for lower bitrates to have higher quality audio output,
and is used by many web radio stations. It was disables on the ESP8266
due to RAM limitations (about 50KB too little), but the ESP32 has no
such problem. Enable it automatically during compile.
ID3 tags can now automatically give your app a callback with different tag
types without any additional work on your application. See the PlayMP3 example
for a very simple example of AudioFileSourceID3's use.
@gerardwr found that the cut-n-pasted original example code could never
actually work, in issue 9. Rewrite so instead of a full working sample
(which would be 40+ lines due to WiFi setup) only the relevant changes are
shown.
AACs can now be played back on the ESP8266 thanks to the RealNetworks
Helix project's AAC decoder. SBR is *not* supported, as there is not
enough RAM in the system to support it.
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.
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.