Skip to content

Commit b77fc8b

Browse files
committed
compile errors
1 parent 9a394ba commit b77fc8b

File tree

3 files changed

+45
-2
lines changed

3 files changed

+45
-2
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
cmake_minimum_required(VERSION 3.20)
2+
3+
# set the project name
4+
project(stk_example)
5+
set (CMAKE_CXX_STANDARD 11)
6+
set (DCMAKE_CXX_FLAGS "-Werror")
7+
8+
include(FetchContent)
9+
option(BUILD_SHARED_LIBS "Build using shared libraries" OFF)
10+
11+
# Build with arduino-audio-tools
12+
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
13+
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../../.. ${CMAKE_CURRENT_BINARY_DIR}/arduino-audio-tools )
14+
endif()
15+
16+
FetchContent_Declare(arduino-stk GIT_REPOSITORY "https://github.com/pschatzmann/Arduino-STK.git" )
17+
FetchContent_GetProperties(arduino-stk)
18+
if(NOT arduino-stk_POPULATED)
19+
FetchContent_Populate(arduino-stk)
20+
add_subdirectory(${arduino-stk_SOURCE_DIR})
21+
endif()
22+
23+
24+
# build sketch as executable
25+
set_source_files_properties(streams-stk_files-audiokit.ino PROPERTIES LANGUAGE CXX)
26+
add_executable (stk_example streams-stk_files-audiokit.ino)
27+
28+
# set preprocessor defines
29+
target_compile_definitions(arduino_emulator PUBLIC -DDEFINE_MAIN)
30+
target_compile_definitions(stk_example PUBLIC -DARDUINO -DIS_DESKTOP -DEXIT_ON_STOP)
31+
32+
# OS/X might need this setting for core audio
33+
#target_compile_definitions(arduino-stk PUBLIC -DPA_USE_COREAUDIO=1)
34+
35+
# specify libraries
36+
target_link_libraries(stk_example arduino-stk_static arduino_emulator arduino-audio-tools arduino-stk)
37+

examples/examples-stk/streams-stk_files-audiokit/streams-stk_files-audiokit.ino

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,17 @@
88
* @copyright Copyright (c) 2021
99
*/
1010

11-
#include "SD_MMC.h"
11+
#ifdef IS_DESKTOP
12+
# define AudioKitStream PortAudioStream
13+
#else
14+
# include "SD_MMC.h"
15+
#endif
1216
#include "AudioTools.h"
1317
#include "AudioLibs/AudioSTK.h"
1418
#include "AudioLibs/AudioKit.h"
1519

20+
21+
1622
STKStream<Instrmnt> in;
1723
AudioKitStream out;
1824
StreamCopy copier;

src/AudioTools/AudioStreams.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,6 @@ class GeneratedSoundStream : public AudioStreamX {
562562
LOGD(LOG_METHOD);
563563
generator_ptr->end();
564564
active = false;
565-
const char* source_not_defined_error = "Source not defined";
566565
}
567566

568567
virtual void setNotifyAudioChange(AudioBaseInfoDependent &bi) override {
@@ -592,6 +591,7 @@ class GeneratedSoundStream : public AudioStreamX {
592591
bool active = false;
593592
SoundGenerator<T> *generator_ptr;
594593
AudioBaseInfoDependent *audioBaseInfoDependent = nullptr;
594+
const char* source_not_defined_error = "Source not defined";
595595

596596
};
597597

0 commit comments

Comments
 (0)