snapshot
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
cmake_minimum_required(VERSION 3.20)
|
||||
|
||||
# set the project name
|
||||
project(mp3-metadata)
|
||||
set (CMAKE_CXX_STANDARD 11)
|
||||
set (DCMAKE_CXX_FLAGS "-Werror")
|
||||
# add_compile_options(-Wstack-usage=1024)
|
||||
|
||||
# Build with arduino-audio-tools
|
||||
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
|
||||
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../../.. ${CMAKE_CURRENT_BINARY_DIR}/arduino-audio-tools )
|
||||
endif()
|
||||
|
||||
# build sketch as executable
|
||||
add_executable (mp3-metadata mp3-metadata.cpp)
|
||||
|
||||
# set preprocessor defines
|
||||
target_compile_definitions(mp3-metadata PUBLIC -DIS_DESKTOP)
|
||||
|
||||
# specify libraries
|
||||
target_link_libraries(mp3-metadata portaudio arduino_emulator arduino-audio-tools)
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
// Simple wrapper for Arduino sketch to compilable with cpp in cmake
|
||||
#include "Arduino.h"
|
||||
#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
|
||||
bool title_printed = false;
|
||||
|
||||
void printMetaData(MetaDataType type, const char* str, int len){
|
||||
Serial.print("==> ");
|
||||
Serial.print(toStr(type));
|
||||
Serial.print(": ");
|
||||
Serial.println(str);
|
||||
title_printed = true;
|
||||
}
|
||||
|
||||
void setup(){
|
||||
Serial.begin(115200);
|
||||
AudioToolsLogger.begin(Serial, AudioToolsLogLevel::Info);
|
||||
|
||||
out.setCallback(printMetaData);
|
||||
out.begin();
|
||||
mp3.begin();
|
||||
}
|
||||
|
||||
void loop(){
|
||||
if (mp3) {
|
||||
copier.copy();
|
||||
} else {
|
||||
assert(title_printed);
|
||||
exit(0);
|
||||
}
|
||||
}
|
||||
17232
libraries/audio-tools/tests-cmake/codec/mp3-metadata/sample-12s.h
Normal file
17232
libraries/audio-tools/tests-cmake/codec/mp3-metadata/sample-12s.h
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user