Tutorial ::

Building SBaGen with Visual Studio 2005...

So you want to make some changes/enhancements/contributions to SBaGen, but you are a Windows developer and can't be bothered with trudging through all the Visual Studio nastyness to get it all compiling cleanly, well here is a step by step guide I put together while I was doing it, so you don't have to..
   What is it?   SBaGen is a cross platform Binaural Beat Generator writen by Jim Peters, please follow the link for more information.
downloadDownload SBaGen
downloadDownload MAD: MPEG Audio Decoder
downloadDownload LibOGG
downloadDownload LibVorbis
NOTE: If you are building with VS .NET 2003 or VS 2008, chances are that this guide will get you 95% of the way there and you'll just have to tweak a few things..

Step 1: Setup

Create a project directory, and extract the sources from the archives listed above:


Setp 2: Create project

Create a new Visuall C++ project for a command line app, call it sbagen_vc and set the location to the project directory you created in step 1, uncheck 'create directory for solution':

After clicking ok, then next, tick the empty project checkbox.


Setp 3: Change project settings

change to Release build:

Change to Use Multi-Byte Character Set

Add the Preprocessor Definitions(T_MSVC MP3_DECODE OGG_DECODE)

Add the sbagen-1.4.4\sbagen.c file to the project

Change the Compile As setting for sbagen.c

Change Runtime Library to multi-threaded:

Add the Additional Include Directories

Add the Additional Library Directories

Add Additional Dependencies


Step 4: Add dependencies to solution

Add existing projects:

Add the LibMAD project to solution:
libmad-0.15.1b\msvc++\libmad.dsp
Answer Yes or Yes to All

Add LibOGG to solution:
libogg-1.1.3\win32\VS2003\libogg\libogg.vcproj
go through the conversion wizard

Add the libvorbis and libvorbisfile projects
libvorbis-1.2.0\win32\VS2005\libvorbis\libvorbis.vcproj
libvorbis-1.2.0\win32\VS2005\libvorbisfile\libvorbisfile.vcproj

Step 5: Change dependencies project settings

Change the output directory for LibMAD to be the lib directory for SBaGen

Change the Configuration Type for the libOGG project to Static Lib (.lib)

Change the LibOGG output directory

Change the Configuration Type for the LibVorbis project to Static Lib (.lib)

Add the Additional Include Directories fo the LibVorbis project

Change the LibVorbis output directory

Change the Configuration Type for the LibVorbisFile project to Static Lib (.lib)

Add the Additional Include Directories fo the LibVorbisFile project

Change the LibVorbisFile output directory


Step 6: Setup project dependencies

Make the sbagen_vc project dependent on the libraries

Step 7: Make code changes

Fix casting error on line 98 of mp3dec.c
from this:

to this:

Change includes in oggdec.c
from this:

to this:

Fix first ov_read signature change on line 116 of oggdec.c
from this:

to this:

Fix second ov_read signature change on line 510 of oggdec.c
from this:

to this:

Step 8: Build the solution

Hit F7 or use menu to build the solution

sbagen_vc.exe will be in sbagen_vc\Release of your project directory..