I'm considering RTAudio + RTMidi and PortAudio + PortMidi for a new project that requires realtime audio and midi procesing. Can anyone with experience using both libraries recommend one over the other? why? I prefer a C++ API over a C API but this is not enough for me to make a decision.
-
2Did you eventually find a good library? I have exactly the same problem... I just did little experiments with PortAudio and it seems quite complex (very low level), it lacks of an official forum (I hate mail list). RTAudio lacks of documentation. [STK](https://ccrma.stanford.edu/software/stk/) has annoying _#include_ policy. [Juce](http://www.rawmaterialsoftware.com/juce.php) does too things, and it is not really focused on realtime audio/midi. I'd like to rely on a maintained cross-platform library, supported by a big community/documentation. – Kill KRT Apr 10 '11 at 10:31
-
3I'm using RTAudio and it's been working fine but I still want to take PortAudio for a spin. The main reason to choose RTAudio was that it has a c++ api instead of c and it's used by open frameworks, which sometimes I use. – Rafael Vega Apr 12 '11 at 05:20
3 Answers
I have been locking for the perfect match with that need for a quite long time. For now I prefer
port audio:
- (+) on Windows, supports asio, DirectSound, MME, WASAPI (with header headaches)
- (+) on Linux, supports ALSA, OSS, Pulse, JACK
- (+) on Mac, supports Core Audio
- (+) very active project,and some good gurus are developing it).
- (+) used by many very successful apps + the C++ is not native but there is a binding that is integrated to the main branch (since last year i think)
- (+) It's really reliable with libsdnfile (which is great)
- (-) It's not native c++
- (-) the projects, configure, integration is pretty annoying
- (-) working well for multiple platforms (debian, osx, seven : my own experience)
- (-) much of the documentation sucks and is mostly outdated and contradictory when googling for answers
rt audio
- (+) on Windows, supports asio, DirectSound, WASAPI (as of 10-04-2014)
- (+) on Linux, supports ALSA, OSS, Pulse, JACK
- (+) on Mac, supports Core Audio
- (+) native c++,
- (+) really easy to get into it
- (-) not so much active
- (-) much of the documentation sucks and is mostly outdated and contradictory when googling for answers
other solutions :
Qt :
- (-) heavy, not exactly what i'm looking for
- (-) real time audio support is recent and not stable
- (+) easy to use if you use QtCreator (and less if using QtAddon with visual, and less with xcode)
- (+) midi integrated
Juce:
- java like design
- heavy, not exactly what i'm looking for
- simple, and working pretty well (used professional audio)
- midi integrated, file reading of aiff and wave, and flac

- 578
- 4
- 9

- 5,344
- 5
- 29
- 37
-
Thanks for the answer! Slightly OOT: Which IDE do you use for this kind of work? I've used xcode, vim, TextMate and/or MakeFiles but I have mixed opinions about all of them. – Rafael Vega May 05 '11 at 10:06
-
2It is an old thread anyway : I use visual on windows, or qtcreator for qt. on mac i use xcode. However for port audio I used just makefiles and gedit on linux. I would say : xcode & visual, great but you have 2 project files. If you work on linux you can do a makefile (or use a tool like scons, or cmake) anyway if you work on linux, just try to find a tool that is portable on mac and windows (with mingw) and everything should be right. Cmake is hard but if you master it you are the king because 1 project, fully portable – dzada Nov 08 '12 at 22:59
-
1https://github.com/thestk/rtaudio seems to be active and support WASAPI now (already mentioned at the very end of the post). – nyanpasu64 Sep 01 '19 at 05:21
The PortAudio Java bindings are oversimplified. For example, you cannot set exclusive mode or shared mode for device access, which is a shame because it effectively steals 7ms of less latency from you -- especially if you capture microphone input (where usually no shared access is necessary) under Windows 10. If you count in output, you lose out on 14 ms RTT for monitoring your mic/stuff.
RtAudio seems to have WASAPI support now, but I'm not sure if it's better than PortAudio's. But are there Java bindings? Wasn't asked in the question, I know, but still ... :)
Another, rather new project is XtAudio. It exposes exclusive and shared access to devices as different sets of devices to the frontend and in general seems to have a better API support. Don't think it supports MIDI tho.

- 1,000
- 6
- 19

- 11,218
- 4
- 45
- 56
-
The link to XtAudio goes to some spam right now, maybe the domain was reacquired. – person27 Nov 26 '19 at 07:38
Here's a relevant thread that came up on the Linux audio devel list. The approach I'll take for my new app(s) is to code for jack and do all my debugging in linux+jack and then use RTAudio for the ports I end up releasing.
Salud!

- 17,944
- 33
- 103
- 135

- 4,575
- 4
- 32
- 50
-
1The link is dead. Can you find a new reference? I'd like to read it. Sorry, got it: http://lists.linuxaudio.org/pipermail/linux-audio-dev/2012-March/031944.html – Tilman Vogel Mar 14 '13 at 23:12