To register and login, use your Google, Twitter, Facebook, LinkedIn, or OpenID credentials.

This is allowing us to stop most spam registrations. We've deleted most of the spam accounts that got through, and we're closely watching for more.

Audio Output on Mac OS X

bastelnbasteln Posts: 6
edited February 2013 in Pd Everywhere

I'm trying to get libpd to work together with cocos2dx, which together should give a really nice cross-platform solution for games and all kinds of music toys :)

libpd comes with the PdAudioController for iOS, but there doesn't seem to be audio output on Mac OS X...I'm starting PD using PDBase::init() and it returns true, but there's no sound...


  • pbrinkmannpbrinkmann Posts: 686 ✭✭

    Take a look at the portaudio branch in GitHub. It adds portable audio output to the Java bindings. I don't think Java is what you want, but the implementation may give you an idea how to do this outside of Java.

  • bastelnbasteln Posts: 6

    I didn't find the portaudio branch you mentioned, but I wrote a small wrapper class which initializes PortAudio and forwards the portaudio callback to libpd_process_float. I have just started writing C++ again, so I'm a little self-conscious to put it online ;-) but it's just a few lines of code anyway.

  • pbrinkmannpbrinkmann Posts: 686 ✭✭

    It's still experimental, but it might be worth a look.

  • reakinatorreakinator Posts: 301

    Hey, sorry for the delay on this..

    About a month and 1/2 ago I started working on OS X support along with some examples on how to get libpd working along a chain of other audio units. I haven't had time to pick it back up, but the wop is in the libpd cocoa branch. I hope to get back to that in the near future...

    Of course, portaudio is a nice option and good if you are thinking to move your game to other platforms as well.

  • reakinatorreakinator Posts: 301

    I should also mention that if you are to use the cocoa branch, it's probably best to start with the CocoaPdBasic sample I put up. It has the same functionality as the iOS version (mic input -> libpd -> speaker output).

  • bastelnbasteln Posts: 6

    thanks...i didn't know that existed, i'm not too experienced with github and branches.

    but implementing it using portaudio was really easy, so i think i'm gonna stick with that...i'm planning to use the audio output from the iOS branch for iOS, and portaudio for everything else except for android. for android i'll see, i'm sure there's an easy way. :)

  • bastelnbasteln Posts: 6

    i mean in the end it would be really cool to have the audio i/o problem solved in a cross-platform way like libpd, so there would be audio i/o for all platforms supported by libpd.

  • pbrinkmannpbrinkmann Posts: 686 ✭✭

    For Android, there's OpenSL. The PortAudio branch is actually a bit of an afterthought. I reworked the Java bindings to support OpenSL, and then I realized that I could just replace OpenSL with PortAudio for wider portability.

  • reakinatorreakinator Posts: 301

    @basteln if cross-platform ease is your goal, portaudio is a very nice route as Peter suggests. However, you get more control over platform features by using the native API's. My main intentions with the cocoa branch were to show how you can use libpd in a chain of effects that include many other high-quality, Mac only audio units. It all depends on what your end requirements are.

    Good news is there are options. :)

Sign In or Register to comment.