snapshot
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
# Decoding a MP3 file with Metadata
|
||||
|
||||
In this example we provide the ID3 metadata from a MP3 file. We support the old ID3V1 and the newer ID3V2.
|
||||
The MetaDataID3 class is used as stream output destination.
|
||||
You register your callback method with setCallback().
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,41 @@
|
||||
/**
|
||||
* @file streams-memory_mp3-metadata.ino
|
||||
* @brief In this example we provide the metadata from a MP3 file.
|
||||
* @author Phil Schatzmann
|
||||
* @copyright GPLv3
|
||||
*/
|
||||
|
||||
#include "AudioTools.h"
|
||||
#include "sample-12s.h"
|
||||
|
||||
|
||||
|
||||
MemoryStream mp3(sample_12s_mp3, sample_12s_mp3_len);
|
||||
MetaDataOutput out;
|
||||
StreamCopy copier(out, mp3); // copy in to out
|
||||
|
||||
// callback for meta data
|
||||
void printMetaData(MetaDataType type, const char* str, int len){
|
||||
Serial.print("==> ");
|
||||
Serial.print(toStr(type));
|
||||
Serial.print(": ");
|
||||
Serial.println(str);
|
||||
}
|
||||
|
||||
void setup(){
|
||||
Serial.begin(115200);
|
||||
AudioToolsLogger.begin(Serial, AudioToolsLogLevel::Info);
|
||||
|
||||
mp3.begin();
|
||||
|
||||
out.setCallback(printMetaData);
|
||||
out.begin();
|
||||
}
|
||||
|
||||
void loop(){
|
||||
if (mp3) {
|
||||
copier.copy();
|
||||
} else {
|
||||
stop();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user