Giter Site home page Giter Site logo

cinder-portaudio's Introduction

Cinder-PortAudio

PortAudio audio backend for cinder.

Supported Platforms

Currently this has only been tested on Windows Desktop, out of need for an ASIO backend. More will be added as needed. Supporting other platforms shouldn't be much more than a matter of getting the project configuration setup, if you'd like to help out with that then please discuss with issues or send a pull request.

Installation

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.

Usage

To use PortAudio as the master audio::Context, add the following include:

#include "cinder/audio/ContextPortAudio.h"

and then make the following call before any other audio calls:

audio::ContextPortAudio::setAsMaster();

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 audio::Device::printDevicesToString().

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 (Debug_NoAsio and Release_NoAsio).

Enabling Windows ASIO backend

For ASIO support, download ASIO Sdk from the Steinberg website here, unzip and move to a folder at lib/ASIOSDK.

Then make sure that the following preprocessor macro is defined in our project:

PA_USE_ASIO=1

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>`:

#undef UNICODE

For more details on this, see the PortAudio docs: "Portaudio Windows ASIO with MSVC"

Debugging

To turn on portaudio debug logging functionality, you can define the following preprocessor macros:

PA_LOG_API_CALLS=1
PA_ENABLE_DEBUG_OUTPUT

If using Visual Studio, you also need the following to see the logs in the console:

PA_ENABLE_MSVC_DEBUG_OUTPUT

cinder-portaudio's People

Contributors

richardeakin avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.