Using the FMOD SDK

If you’re new to FMOD, I recommend using the version included with the book to ensure compatibility, since a high-quality book like this one will remain on the market for many years. When you are familiar with FMOD, visit Firelight Technologies’ website at www.fmod.org and download the latest version.

FMOD is composed of a library file, a DLL, and these header files:

  • fmod.h

  • fmod.hpp

  • fmod_codec.h

  • fmod_dsp.h

  • fmod_errors.h

  • fmod_output.h

If you’re writing code in C, then use the fmod.h header, but if you’re using C++, use the fmod.hpp header. You only need to include the main header, because it includes the others. An FMOD library file is available for Visual C++ and Dev-C++ and is included in the example project for this chapter (a program called AudioTest that we’ll go over later). Here are the library files:

  • Visual C++: fmodex_vc.lib

  • Dev-C++: libfmodex.a

Of course, these files from the FMOD SDK are only needed to compile your game with FMOD support. Once your game is built, you no longer need these files. Instead, you will need the FMOD runtime file (which is the same for both compilers):

  • fmodex.dll

Advice

FMOD cannot be distributed freely unless you abide by the terms of use specified by Firelight Technologies at the www.fmod.org website. If you release a freeware game, you must include Firelight’s official copyright notice! I secured permission to include the FMOD SDK files with this book.


The best way to learn how to use the FMOD SDK is to see an example. Instead of a demo program, I’m going to show you a pair of C++ classes that encapsulate FMOD into convenient properties and methods. Don’t get me wrong—FMOD is not difficult to use. But rather than going over the initialization and usage of FMOD and its support functions, we’ll instead examine the code used to build the classes.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset