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:
1 parent
7a7f8bf449
commit
96fc37dce5
12 files changed
+113
-175
No files matched your search
@@ -1,11 +1,11 @@
|
||||
#include <Arduino.h>
|
||||
#include <AudioOutputI2SDAC.h>
|
||||
#include <AudioOutputI2S.h>
|
||||
#include <AudioFileSourcePROGMEM.h>
|
||||
#include <AudioGeneratorFLAC.h>
|
||||
|
||||
#include "sample.h"
|
||||
|
||||
AudioOutputI2SDAC *out;
|
||||
AudioOutputI2S *out;
|
||||
AudioFileSourcePROGMEM *file;
|
||||
AudioGeneratorFLAC *flac;
|
||||
|
||||
@@ -14,7 +14,7 @@ void setup()
|
||||
Serial.begin(115200);
|
||||
Serial.println("Starting up...\n");
|
||||
file = new AudioFileSourcePROGMEM( sample_flac, sizeof(sample_flac) );
|
||||
out = new AudioOutputI2SDAC();
|
||||
out = new AudioOutputI2S();
|
||||
flac = new AudioGeneratorFLAC();
|
||||
flac->begin(file, out);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user