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,7 +1,7 @@
|
||||
#include <Arduino.h>
|
||||
#include "AudioFileSourcePROGMEM.h"
|
||||
#include "AudioGeneratorMOD.h"
|
||||
#include "AudioOutputI2SDAC.h"
|
||||
#include "AudioOutputI2S.h"
|
||||
#ifdef ESP32
|
||||
#include <WiFi.h>
|
||||
#else
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
AudioGeneratorMOD *mod;
|
||||
AudioFileSourcePROGMEM *file;
|
||||
AudioOutputI2SDAC *out;
|
||||
AudioOutputI2S *out;
|
||||
|
||||
void setup()
|
||||
{
|
||||
@@ -21,7 +21,7 @@ void setup()
|
||||
Serial.begin(115200);
|
||||
delay(1000);
|
||||
file = new AudioFileSourcePROGMEM( enigma_mod, sizeof(enigma_mod) );
|
||||
out = new AudioOutputI2SDAC();
|
||||
out = new AudioOutputI2S();
|
||||
mod = new AudioGeneratorMOD();
|
||||
mod->SetBufferSize(3*1024);
|
||||
mod->SetSampleRate(44100);
|
||||
|
||||
Reference in new issue
Block a user