This commit is contained in:
2026-02-12 21:00:02 -08:00
parent 77f8236347
commit 8bdbf227ca
1141 changed files with 1010880 additions and 2 deletions

View File

@@ -0,0 +1,34 @@
cmake_minimum_required(VERSION 3.20)
# set the project name
project(aac-helix)
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 libhelix
FetchContent_Declare(helix GIT_REPOSITORY "https://github.com/pschatzmann/arduino-libhelix.git" GIT_TAG main )
FetchContent_GetProperties(helix)
if(NOT helix_POPULATED)
FetchContent_Populate(helix)
add_subdirectory(${helix_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/helix)
endif()
# build sketch as executable
add_executable (aac-helix aac-helix.cpp)
# set preprocessor defines
target_compile_definitions(aac-helix PUBLIC -DARDUINO -DUSE_PORTAUDIO -DIS_DESKTOP)
# OS/X might need this setting for core audio
#target_compile_definitions(portaudio PUBLIC -DPA_USE_COREAUDIO=1)
# specify libraries
target_link_libraries(aac-helix portaudio arduino_emulator arduino_helix arduino-audio-tools)

View File

@@ -0,0 +1,32 @@
#include "Arduino.h"
#include "AudioTools.h"
#include "AudioTools/AudioCodecs/CodecAACHelix.h"
#include "AudioTools/AudioLibs/PortAudioStream.h"
#include "audio.h"
MemoryStream aac(gs_16b_2c_44100hz_aac, gs_16b_2c_44100hz_aac_len);
PortAudioStream portaudio_stream; // Output of sound on desktop
EncodedAudioStream dec(&portaudio_stream, new AACDecoderHelix()); // aac data source
StreamCopy copier(dec, aac); // copy in to out
void setup(){
Serial.begin(115200);
AudioToolsLogger.begin(Serial, AudioToolsLogLevel::Info);
dec.addNotifyAudioChange(portaudio_stream);
dec.begin();
portaudio_stream.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);
}
}

File diff suppressed because it is too large Load Diff