New to programming PortAudio ... Need help on how to use it without callbacks

I’m an experienced software engineer. I just started experimenting with the PortAudio API for a new project.

I am trying to write software that read data from and writes data to several audio devices. I already have software written that has a low latency (less than 10ms) audio processing loop. I’m looking for a way to read data from 1 or more audio input devices, and write data to one or more audio devices, from within my processing loop. What would work best is something that behaves similar to the Linux ALSA API calls.

I looked at the PortAudio API. I like the fact that it is cross platform, but it seems to be designed around the concept of “callback” functions for reading data from and writing data to the audio ports. That would needlessly complicate my existing software.

Does anyone know how to use the PortAudio API to just read data from an input audio port when it’s available, and write sample data to an output audio port at the regular interval for the selected sample rate, without using a callback?

FWIW: We’re looking to switch away from PortAudio in the medium term in favor of Musescore’s audio engine. That one probably isn’t ready yet for your purposes though (or ours for that matter) as it doesn’t do audio recording.

This topic was automatically closed after 30 days. New replies are no longer allowed.