Numerix Corporate Details  

PortAudio, wxWidgets, Borland C/C++ and SigLib Compilation Information

  SigLib Library   Digital Filter Plus

Home Page | SigLib DSP Library | DFPlus™ Filter Designer

SigLib User Contributed Files


Borland C/C++ and wxWidgets (formerly wxWindows) Installation Notes

These instructions are for wxWidgets V 2.4.1 if I do not change this document for every release then please adjust accordingly.

You can get the free Borland command line tools from : http://info.borland.com/devsupport/bcppbuilder/patches/ . In order to use this with wxWidgets you will need to get all of the latest patches. Install these tools - this is very straight forward.

Set the following environment varibles :

SET BCCDIR=c:\borland\bcc55
SET WXWIN=c:\wxWidgets-2.4.1
- please note that the default installation directory is wxWidgets_2.4.1 but the Borland tools do not like this so I always change it to wxWidgets-2.4.1.

Read the wxWidgets installation guide : install_msw-2.4.1.txt

Now rebuild wxWidgets :

cd wx2\src\msw
make -f makefile.b32

 

PortAudio Compilation Information For Borland C/C++ And wxWidgets

I have now ported my code to PortAudio version 19 and have found it very stable when using it with wxWidgets and SigLib

I build PortAudio into a library using these steps in the pa_win_wmme directory :

bcc32 @wxw32d.cfg -c -DPA_NO_DS=1 -DPA_NO_ASIO=1 "-ID:\Program Files\Borland\BCC55\Include" "-I..\pa_common" ..\pa_common\*.c ..\pa_win\*.c ..\pa_win_wmme\*.c

tlib wportaudio -+pa_allocation.obj
tlib wportaudio -+pa_converters.obj
tlib wportaudio -+pa_cpuload.obj
tlib wportaudio -+pa_dither.obj
tlib wportaudio -+pa_front.obj
tlib wportaudio -+pa_process.obj
tlib wportaudio -+pa_skeleton.obj
tlib wportaudio -+pa_stream.obj
tlib wportaudio -+pa_trace.obj
tlib wportaudio -+pa_win_hostapis.obj
tlib wportaudio -+pa_win_util.obj
tlib wportaudio -+pa_win_wmme.obj
tlib wportaudio -+pa_x86_plain_converters.obj

I build PortAudio into a library using these steps in the pa_win_ds directory :

bcc32 @wxw32d.cfg -c -DPA_NO_WMME=1 -DPA_NO_ASIO=1 "-ID:\Program Files\Borland\BCC55\Include" "-I..\pa_common" ..\pa_common\*.c ..\pa_win\*.c ..\pa_win_ds\*.c

tlib wportaudio -+pa_allocation.obj
tlib wportaudio -+pa_converters.obj
tlib wportaudio -+pa_cpuload.obj
tlib wportaudio -+pa_dither.obj
tlib wportaudio -+pa_front.obj
tlib wportaudio -+pa_process.obj
tlib wportaudio -+pa_skeleton.obj
tlib wportaudio -+pa_stream.obj
tlib wportaudio -+pa_trace.obj
tlib wportaudio -+pa_win_hostapis.obj
tlib wportaudio -+pa_win_util.obj
tlib wportaudio -+pa_win_ds.obj
tlib wportaudio -+dsound_wrapper.obj
tlib wportaudio -+pa_x86_plain_converters.obj

Here is the wxw32.cfg file that I use for PortAudio :

-Hc
-H=c:\wxWidgets_2.4.1\src\msw\wx32.csm
-3
-d
-a1
-R-
-X
-w-par
-w-aus
-w-hid
-tWM

-D__WXWIN__
-D__WXMSW__
-D__WINDOWS__
-DWIN32
-v -DWXDEBUG=1 -D__WXDEBUG__ -DUSE_DEFINE
-D__WIN95__ -D__WINDOWS__

If you want to use PortAudio in a command line application then you do not need to use the wxw32.cfg file.

In order to compile V19 you will need to obtain tasm32.exe, which is not available with the freely downloadable compiler tools.

Then I just specify portaudio.lib in the EXTRALIBS section of makefile.b32 when I build my application.

 

Port Audio Compilation Information For Borland C/C++

To build the PortAudio examples with the Borland C/C++ V5.5 command line compiler use the following command :

bcc32 "-ID:\Program Files\Borland\BCC55\Include" "-LD:\Program Files\Borland\BCC55\Lib" "-I..\pa_common" wintest.cpp ..\pa_common\*.c ..\pa_win_wmme\*.c

 

Port Audio Compilation Information For Microsoft Visual C/C++

These instructions are vor v18 of PortAudio because I have not yet used V19 to build PortAudio into a library.

Create an MSVC Win32 Static Library "pa_win_ds"
Add the following files to the project :

dsound_wrapper.c
dsound_wrapper.h
pa_dsound.c
portaudio.def

Add the following "Additional include directories" to the project : C:\portaudio_v18\pa_common.

To build an application using PortAudio, follow these steps :

Created an MSVC command line project and suck in patest_record.c this example records 5 seconds of audio and then plays it back again.

Add the following files to the project :

pa_common\pa_lib.c
pa_common\portaudio.h
pa_common\pa_host.h

Make the following project modifications :

Select "automatic use of precompiled headers"
Add dsound.lib and winmm.lib and C:\portaudio_v18\pa_win_ds\Debug\pa_win_ds.lib to the linker

Note : For MSVC I used the DirectSound version of PortAudio. Please visit the Microsoft web site to get the latest version of DirectX (9.0a).

Here is a useful tip when using PortAudio with a GUI :

Modify PaUtil_DebugPrint in pa_front.c as shown below and the debug statements will be written to the file debug.log.

void PaUtil_DebugPrint( const char *format, ... )
{
va_list ap;

FILE *logFile;
logFile = fopen( "debug.log", "a" );

va_start( ap, format );
// vfprintf( stderr, format, ap );
vfprintf( logFile, format, ap );
va_end( ap );

// fflush( stderr );
fclose( logFile );
}


Home Page | SigLib™ DSP Library | DFPlus™ Filter Designer

If you have any comments or questions please email Numerix : numerix@numerix-dsp.com
Copyright © 2008, Indigo Consulting Ltd.. Permission is granted to create WWW pointers to this document. All other rights reserved. SigLib is a trademark of Indigo Consulting Ltd.. All trademarks acknowledged.