Port Audio::PortAudio to FFI::Raw. Patch FFI::Raw as necessary and build FFI::Raw::Sweet or something to make this easy. References Audio::PortAudio https://metacpan.org/release/Audio-PortAudio libportaudio http://www.portaudio.com/ http://portaudio.com/docs/v19-doxydocs/api_overview.html http://portaudio.com/docs/v19-doxydocs/portaudio_8h.html Perl FFI::Raw https://metacpan.org/release/FFI-Raw https://github.com/ghedo/p5-FFI-Raw https://metacpan.org/requires/module/FFI::Raw libffi https://github.com/atgreen/libffi https://sourceware.org/libffi/ Blog on using libffi from C Ruby's Portaudio via ffi https://github.com/jvoorhis/ruby-portaudio Ruby's FFI https://github.com/ffi/ffi/wiki https://github.com/ffi/ffi https://groups.google.com/forum/#!forum/ruby-ffi Python's ctypes (on libffi) http://docs.python.org/2/library/ctypes.html Blog on using ctypes