How do I play or record a file using PortAudio?
We do not recommend doing file I/O in the PortAudio callback because the callback is run at a very high priority. We recommend reading the data in a normal priority thread then writing it to a FIFO which is read by the PortAudio callback. V19 has special functions called Pa_WriteStream() and Pa_ReadStream() for doing stream I/O though a FIFO.