I was struggling with an ugly problem and wished it would be possible to compile and run or debug my Audio Arduino Sketch on my Desktop Computer.

So I decided to release my arduino-emulator and extend my arduino-audio-tools project and provide an example how to compile and run it in Windows, Linux or OS/X.

  • You just need to provide an Arduino Sketch as cpp file together with this CMakeLists.txt example file. Just replace the example generator.cpp with your Arduino Sketch as cpp file in the add_executable line.

  • In your sketch you can use the PortAudioStream class which uses PortAudio to input or output audio.

  • The CMakeLists.txt file automatically downloads all dependencies (including the arduino-audio-tools project).

  • Finally you can build the executable (the cmake way) with:

mkdir build
cd build
cmake ..

If you want to use the debugger use cmake -DCMAKE_BUILD_TYPE=DEBUG .. instead of cmake ...

A full example can be found in the examples-desktop directory.

Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *