Portaudio is a cross platform open source audio API. It supports Linux, Windows and MacOSX. It provides the simple C programming API for audio programming. It seems wrap the low level audio driver such as DirectX and ASIO. Here are some notes when I tried to use it under windows platform.
1. Configure the development environment in windows XP platform:
1) Download the source code of the portaudio and :
http://www.portaudio.com/download.html (there is no platform dependent source code). I used snapshot (latest on the day).
2) For fully supporting low latency Steinberg ASIO audio driver, you will
need to download the ASIO SDK:
follow the instruction in \portaudio\build\msvc\readme.txt, to copy the files form ASIO SDK source code into the portaudio \portaudio\src\hostapi\asio
3) Also for fully support DirectSound from Microsoft, you will need to download Microsoft DirectX SDK and Microsoft Windows Platform SDK (if you have not installed before, it looks like server SDK) as well. If you have problem with the library path etc, check this link.
4) You can use Visual C++ Express 2008 to compile it which is freely downloadable from Microsoft. The solution file can be converted into new format.
2. compile the sample code:
Double-click the “portaudio\build\msvc\ portaudio.sln” file and compile or build as normal. It should be built successfully. You will find some useful files in the debug directory, portaudio.lib and portaudio_x86.dll.
To compile a test program use portaudio library. You will need to add a new project into current solution, following through the instruction here:
Add new project into portaudio solution
Create win32 console application
Change setting by un-checking the “precompiled header”
Remove the other auto generated source code only leave the sinetest.cpp. Right click the sintest project and change the references to add new reference to the portaudio project.
And also modify the c/c++ general property to add portaudio include path.
Copy the content of patest_sine.c into sinetest.cpp (rename to sinetest.c). Add portaudio.h into header files folder in visual stiduo.
Then you can find your first portaudio executable file sinetest.exe at folder:
You may need portaudio_x86.dll at same folder to run the program. Good Luck!
Tips: The DirectX SDK I used (August 2009) did not insert paths information to Visual Studio. The simplest way to solve this problem is to run the “dx_setenv.cmd” script from:
C:\Program Files\Microsoft DirectX SDK (August 2009)\Utilities\bin