Per definition ogg files should use the Vorbis file format using Ogg framing. Ogg Vorbis is a fully open, non-proprietary, patent-and-royalty-free, general-purpose compressed audio format for mid to high quality: So it is basically the open source alternative to mp3!
xiph.org provides an integer only decoder implementation which is based on pure “C”.
I am providing this version as Arduino Library.
Like Flac from my last post, the API is using a callback pull mechanism to receive the encoded audio data, so I decided to provide a proper StreamingDecoder subclass for this mechanism and officially support it as it is intended to be used. The use is exactly like Flac:
#include "AudioTools.h"
#include "AudioCodecs/CodecVorbis.h"
const char* ssid = "ssid";
const char* pwd = "password";
URLStream url(ssid, pwd);
VorbisDecoder dec;
I2SStream i2s;
void setup() {
Serial.begin(115200);
AudioLogger::instance().begin(Serial, AudioLogger::Info);
i2s.begin(i2s.defaultConfig(TX_MODE));
url.begin("http://marmalade.scenesat.com:8086/bitjam.ogg","application/ogg");
dec.setInputStream(url);
dec.setOutputStream(i2s);
dec.begin();
}
void loop() {
dec.copy();
}
Github
The potentially updated version can be found on Github.
0 Comments