Add FLAC support to the framework via libflac-1.3.2
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.
This commit is contained in:
1 parent
0a453a077a
commit
685dcbf18d
82 files changed
+28798
-1
No files matched your search
@@ -0,0 +1,31 @@
|
||||
#include <Arduino.h>
|
||||
#include <AudioOutputI2SDAC.h>
|
||||
#include <AudioFileSourcePROGMEM.h>
|
||||
#include <AudioGeneratorFLAC.h>
|
||||
|
||||
#include "sample.h"
|
||||
|
||||
AudioOutputI2SDAC *out;
|
||||
AudioFileSourcePROGMEM *file;
|
||||
AudioGeneratorFLAC *flac;
|
||||
|
||||
void setup()
|
||||
{
|
||||
Serial.begin(115200);
|
||||
Serial.println("Starting up...\n");
|
||||
file = new AudioFileSourcePROGMEM( sample_flac, sizeof(sample_flac) );
|
||||
out = new AudioOutputI2SDAC();
|
||||
flac = new AudioGeneratorFLAC();
|
||||
flac->begin(file, out);
|
||||
}
|
||||
|
||||
void loop()
|
||||
{
|
||||
if (flac->isRunning()) {
|
||||
if (!flac->loop()) flac->stop();
|
||||
} else {
|
||||
Serial.printf("FLAC done\n");
|
||||
delay(1000);
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user