Add Opus file format (and OGG demux) (#294)
Add ported versions of the Opus codec, OpusFile parser, and OGG demuxer from Xiph.org. Only works on the ESP32 due to memory limitations (of opusfile, strangely enough, and not because of opus compression). Adds a basic example and a host test. Fixes #278
This commit is contained in:
1 parent
7c379748b1
commit
fae26d4010
278 files changed
+63024
-3
No files matched your search
@@ -0,0 +1,25 @@
|
||||
#include <Arduino.h>
|
||||
#include "AudioFileSourceSTDIO.h"
|
||||
#include "AudioOutputSTDIO.h"
|
||||
#include "AudioGeneratorOpus.h"
|
||||
|
||||
#define OPUS "../../examples/PlayOpusFromSPIFFS/data/gs-16b-2c-44100hz.opus"
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
(void) argc;
|
||||
(void) argv;
|
||||
|
||||
AudioFileSourceSTDIO *file = new AudioFileSourceSTDIO(OPUS);
|
||||
AudioOutputSTDIO *out = new AudioOutputSTDIO();
|
||||
out->SetFilename("opus.wav");
|
||||
AudioGeneratorOpus *opus = new AudioGeneratorOpus();
|
||||
|
||||
opus->begin(file, out);
|
||||
while (opus->loop()) { /*noop*/ }
|
||||
opus->stop();
|
||||
|
||||
delete out;
|
||||
delete opus;
|
||||
delete file;
|
||||
}
|
||||
Reference in new issue
Block a user