PortAudio audio backend for cinder.
Initial development was done on Windows 10 Desktop, with a focus on enabling the ASIO backend, with included VS 2015 project files. @PetrosKataras added CMake support, which can be used on most other platforms (Linux, Mac OS X, etc).
You can use TinderBox to create a startup project. Clone this repo into your cinder/blocks folder and select the template "PortAudio: Sinewave". Note that the cinderblock.xml is setup to create a project with ASIO support, due to Steinberg's licensing you'll need to install the ASIO SDK following the instructions below.
To use PortAudio as the master
audio::Context, add the following include:
and then make the following call before any other audio calls:
After that, you can use
audio::master() like you usually would with cinder's built in
audio::Context implementations, and you can query which devices are available with the usual
Also see the PortAudioBasic sample for how to get up and running. It has two sets of configurations, one with ASIO support and one without (
Enabling Windows ASIO backend
For ASIO support, download ASIO Sdk from the Steinberg website here, unzip and move to a folder at
Then make sure that the following preprocessor macro is defined in our project:
Lastly, include the following sources in your project:
lib/portaudio/src/hostapi/asio/* lib/ASIOSDK/common/asio.cpp lib/ASIOSDK/host/asiodrivers.cpp lib/ASIOSDK/host/pc/asiolist.cpp
Enable Unicode Character Set
Most cinder projects are build with Unicode Character Set (Configuration Properties -> General -> Character Set) and to make ASIO compatible with this, you need to add the following line to the top of lib/ASIOSDK/host/pc/asiolist.cpp, directly above the <#include "windows.h>`:
For more details on this, see the PortAudio docs: "Portaudio Windows ASIO with MSVC"
To turn on portaudio debug logging functionality, you can define the following preprocessor macros:
If using Visual Studio, you also need the following to see the logs in the console: