snapshot
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
cmake_minimum_required(VERSION 2.34)
|
||||
|
||||
# set the project name
|
||||
project(aac-faad)
|
||||
set (CMAKE_CXX_STANDARD 11)
|
||||
set (DCMAKE_CXX_FLAGS -Werror )
|
||||
# add_compile_options(-Wstack-usage=1024)
|
||||
|
||||
include(FetchContent)
|
||||
|
||||
# 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 with libfaad
|
||||
FetchContent_Declare(libfaad GIT_REPOSITORY https://github.com/pschatzmann/arduino-libfaad.git GIT_TAG main )
|
||||
FetchContent_GetProperties(libfaad)
|
||||
if(NOT libfaad_POPULATED)
|
||||
FetchContent_Populate(libfaad)
|
||||
add_subdirectory(${libfaad_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/libfaad)
|
||||
endif()
|
||||
|
||||
# build sketch as executable
|
||||
add_executable (aac-faad aac-faad.cpp)
|
||||
|
||||
# set preprocessor defines
|
||||
target_compile_definitions(aac-faad PUBLIC -DARDUINO -DIS_DESKTOP -DANALYSIS)
|
||||
|
||||
# OS/X might need this setting for core audio
|
||||
#target_compile_definitions(portaudio PUBLIC -DPA_USE_COREAUDIO=1)
|
||||
|
||||
# specify libraries
|
||||
target_link_libraries(aac-faad arduino_emulator libfaad arduino-audio-tools)
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
#include "Arduino.h"
|
||||
#include "AudioTools.h"
|
||||
#include "AudioTools/AudioCodecs/CodecAACFAAD.h"
|
||||
//#include "AudioTools/AudioLibs/PortAudioStream.h"
|
||||
#include "audio.h"
|
||||
|
||||
MemoryStream aac(gs_16b_2c_44100hz_aac, gs_16b_2c_44100hz_aac_len);
|
||||
//PortAudioStream out; // Output of sound on desktop
|
||||
CsvOutput<int16_t> out(Serial, 2);
|
||||
EncodedAudioStream dec(&out, new AACDecoderFAAD()); // aac data source
|
||||
StreamCopy copier(dec, aac); // copy in to out
|
||||
|
||||
void setup(){
|
||||
Serial.begin(115200);
|
||||
AudioToolsLogger.begin(Serial, AudioToolsLogLevel::Info);
|
||||
|
||||
dec.begin();
|
||||
|
||||
out.begin();
|
||||
}
|
||||
|
||||
void loop(){
|
||||
if (aac) {
|
||||
copier.copy();
|
||||
} else {
|
||||
auto info = dec.decoder().audioInfo();
|
||||
LOGI("The audio rate from the aac file is %d", info.sample_rate);
|
||||
LOGI("The channels from the aac file is %d", info.channels);
|
||||
exit(0);
|
||||
}
|
||||
}
|
||||
|
||||
20136
libraries/audio-tools/tests-cmake/codec/aac-faad/audio.h
Normal file
20136
libraries/audio-tools/tests-cmake/codec/aac-faad/audio.h
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user