Files
ESP8266Audio/tests/host/opus.cpp
T
Earle F. Philhower, III f1d74df9f7 Rewrite OPUS driver, no extra libs, update (#780)
Move to Opus 1.5.1
Remove OpusFile and OGG libraries because we parse the OGG file in
the object directly with way less memory and overhead.

Update example for LittleFS and RP2040

Fixes #372
2025-10-10 15:19:20 -07:00

26 lines
613 B
C++

#include <Arduino.h>
#include "AudioFileSourceSTDIO.h"
#include "AudioOutputSTDIO.h"
#include "AudioGeneratorOpus.h"
#define OPUS "../../examples/PlayOpusFromLittleFS/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;
}