File tree Expand file tree Collapse file tree 3 files changed +45
-2
lines changed
examples/examples-stk/streams-stk_files-audiokit Expand file tree Collapse file tree 3 files changed +45
-2
lines changed Original file line number Diff line number Diff line change
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
+
Original file line number Diff line number Diff line change 8
8
* @copyright Copyright (c) 2021
9
9
*/
10
10
11
- #include " SD_MMC.h"
11
+ #ifdef IS_DESKTOP
12
+ # define AudioKitStream PortAudioStream
13
+ #else
14
+ # include " SD_MMC.h"
15
+ #endif
12
16
#include " AudioTools.h"
13
17
#include " AudioLibs/AudioSTK.h"
14
18
#include " AudioLibs/AudioKit.h"
15
19
20
+
21
+
16
22
STKStream<Instrmnt> in;
17
23
AudioKitStream out;
18
24
StreamCopy copier;
Original file line number Diff line number Diff line change @@ -562,7 +562,6 @@ class GeneratedSoundStream : public AudioStreamX {
562
562
LOGD (LOG_METHOD);
563
563
generator_ptr->end ();
564
564
active = false ;
565
- const char * source_not_defined_error = " Source not defined" ;
566
565
}
567
566
568
567
virtual void setNotifyAudioChange (AudioBaseInfoDependent &bi) override {
@@ -592,6 +591,7 @@ class GeneratedSoundStream : public AudioStreamX {
592
591
bool active = false ;
593
592
SoundGenerator<T> *generator_ptr;
594
593
AudioBaseInfoDependent *audioBaseInfoDependent = nullptr ;
594
+ const char * source_not_defined_error = " Source not defined" ;
595
595
596
596
};
597
597
You can’t perform that action at this time.
0 commit comments