This tutorial will introduce you some basis of FMOD Ex &
NativeFmodEx.
If you don't have installed NativeFmod[Ex] yet, look at
Tutorial 01.
NativeFmodEx use native libraries (dll, so or jnilib depending on the platform).
The first thing to do is to check that
all requiered libraries can be found and are well loaded.
This can be done with :
Loading |
try |
What are ***_MINIMUM mode ?
These modes are associated with Callbacks.
If you don't need callbacks, use this mode.
At start, some internal memory is initialized for objects used only by
callbacks. Using this mode will allow you control this memory initialization (ie memory not allocated).
What happens if loadLibraries is not
called ?
An exception (RuntimeException) occure :
Not loaded |
java.lang.RuntimeException: Libraries not loaded ! Use Init.loadLibraries() before using NativeFmodEx. |
How to solve "Libraries not loaded" ?
There is two ways to solve this :
- add the path of the libraries in
java.library.path
- copy libraries in the bin (Windows) or in lib/i386 (Linux) folder of
your JRE/JDK.
This is not requiered, but I advise you to check that
the version of the jar and the library are the same.
If versions are different, this means you use a bad jar or library.
ALWAYS use a jar and a library with the same
version !
Version checking (NativeFmodEx) |
if(NATIVEFMODEX_LIBRARY_VERSION != NATIVEFMODEX_JAR_VERSION) |
After this, you are ready for your first steps with
FMOD Ex & Java.
This is the first FMOD Ex object you will use.
An FMOD Ex System object is used to initialize the sound device, create Sound,
DSP and Geometry objects ...
Like for NativeFmodEx, you can check the version.
Here, you CAN use any versions of FMOD Ex
>= to the advice version (FMOD_VERSION).
Don't use an older version (< FMOD_VERSION).
It is even higly recommended to use the last FMOD library available !
Creating a System & Check version (FMOD Ex) |
//Create an instance |
Note: we will see what
is ERRCHECK in the following.
Then, you need to initialize the System.
You can either let FMOD use default settings or use a specific output, driver
...
Be carefull, this code (output, driver ...) is a platform dependant code. You have to
take attention on which system is running the application and made the right
initialization depending it.
This should be done before initializing
the system.
Custom initializaion |
if(FmodEx.getPlatform() == WIN32 || FmodEx.getPlatform() == WIN64) |
Then, initilize :
Initialize |
result = system.init(32, FMOD_INIT_NORMAL, null); |
Now, you are ready to do all you want with FMOD Ex.
Take a look to FMOD Ex examples
(included in SDK archive) to learn the basis and more.
Here is a list of basic FMOD Ex examples :
PlaySound / PlayStream play some musics from the hard drive.
LoadFromMemory play some musics from the memory (usefull to play musics packed into a jar).
NetStream play a music from the web (using http protocol)
CDPlayer play an Audio CD
Recording/RecordToDisc record
DspPluginViewer plugins and spectrum/oscillator display
Geometry_ 3D scene with musical environment
... and more such as ChannlGroups, CodecRaw, DspCustom, DspEffectPerSpeaker, DspGainMain, Effects, FileCallbacks, GenerateTone, MultipleSoundcard, MultiSpeakerOutput, OfflineDecoding, PitchDetection, PlayList, ReadTags, RealtimeStitching, SubMixing, UsePlugins, UserCreatedSound, VirtualVoices.
and FMOD Designer examples :
SimpleEvent Getting start with FMOD Designer
RealtimeTweaking use the 'Net Event System' library to connect the FMOD Designer application to a currently running program using FMOD Designer library. This allow to change in realtime the settings of the FMOD Designer project used by this program.
Demo3D aquivalent of Geometry_ with FMOD Designer
ProgrammerSound use
of EVENT_CALLBACK callback.
Last modified on 01/07/2010 | |
Copyright © 2004-2010 Jérôme JOUVIE - All rights reserved. | http://jerome.jouvie.free.fr/ |