Saturday, 20 January 2018

Compiling PortAudio with Cygwin/GCC

In this post : http://blog.numerix-dsp.com/2018/01/notes-on-using-cygwin-for-dsp.html. I described using Cygwin and GCC for developing Digital Signal Processing algorithms.

I like to use PortAudio for audio I/O and testing audio signal processing algorithms, particularly using the XMOS xCORE-200 Multichannel Audio Platform : https://www.xmos.com/support/boards?product=18334.

Here are my list of instructions for compiling and using PortAudio with Cygwin/GCC.

To build PortAudio using Cygwin/GCC, execute the following commands in the Cygwin command prompt (Note, the default configure/make creates a .dll library. This works perfectly well but I prefer static linking because then I do not have to worry about locating the .dll file) :

cd /cygdrive/c/portaudio_v19
chmod +x configure
./configure --enable-static --disable-shared --with-winapi=wmme,wasapi,wdmks
make

To get a list of the supported APIs, use the following command :

./configure --help

The results are :

--with-winapi           Select Windows API support
                          ([wmme|directx|asio|wasapi|wdmks][,...]) [wmme]

Now to build an example in a DOS or Cygwin command prompt (e.g. C:\portaudio_v19\examples\paex_sine.c) use the following command line :
gcc paex_sine.c -Wall -Wno-main -Wno-unused-value -std=c99 -I ../include -L ../lib/.libs -l portaudio -o paex_sine.exe -lrt -lwinmm -mthreads

pa_devs is a really useful utility for listing all the audio interfaces :
gcc pa_devs.c -Wall -Wno-main -Wno-unused-value -std=c99 -I ../include -L ../lib/.libs -l portaudio -o pa_devs.exe -lrt -lwinmm -mthreads

If you have found this solution useful then please do hit the Google (+1) button so that others may be able to find it as well.

Evaluate The Numerix-DSP Libraries : http://www.numerix-dsp.com/eval/

No comments:

Post a comment