Refactor I2S to be cleaner, more extensible

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.
This commit is contained in:
Earle F. Philhower, III committed 2018-01-25 19:15:02 -08:00
1 parent 7a7f8bf449
commit 96fc37dce5
12 files changed
+113 -175

No files matched your search

@@ -8,13 +8,13 @@
#include <AudioOutputNull.h>
#include <AudioOutputI2SDAC.h>
#include <AudioOutputI2S.h>
#include <AudioGeneratorMIDI.h>
#include <AudioFileSourceSPIFFS.h>
AudioFileSourceSPIFFS *sf2;
AudioFileSourceSPIFFS *mid;
AudioOutputI2SDAC *dac;
AudioOutputI2S *dac;
AudioGeneratorMIDI *midi;
void setup()
@@ -30,7 +30,7 @@ void setup()
sf2 = new AudioFileSourceSPIFFS(soundfont);
mid = new AudioFileSourceSPIFFS(midifile);
dac = new AudioOutputI2SDAC();
dac = new AudioOutputI2S();
midi = new AudioGeneratorMIDI();
midi->SetSoundfont(sf2);
midi->SetSampleRate(22050);