| 1 |
## fmod |
| 2 |
|
| 3 |
This service links your project with https://castle-engine.io/fmod[FMOD] on Android. |
| 4 |
|
| 5 |
### Declare in CastleEngineManifest.xml |
| 6 |
|
| 7 |
Declare it like this in link:https://castle-engine.io/project_manifest[CastleEngineManifest.xml]: |
| 8 |
|
| 9 |
[source,xml] |
| 10 |
---- |
| 11 |
<?xml version="1.0" encoding="utf-8"?> |
| 12 |
<project name="..." game_units="..."> |
| 13 |
<android> |
| 14 |
<services> |
| 15 |
<service name="fmod"> |
| 16 |
<parameter key="library_path" value="fmod-android-library" /> |
| 17 |
</service> |
| 18 |
</services> |
| 19 |
</android> |
| 20 |
</project> |
| 21 |
---- |
| 22 |
|
| 23 |
You need to download the _FMOD Engine_ for _Android_ from https://www.fmod.com/ yourself (any version 2.x is OK, so just take the latest). Make sure you understand the FMOD licensing and pricing terms. FMOD is not open-source, and it is not free (although they have some clauses friendly to indie game companies without big revenue). |
| 24 |
|
| 25 |
The `library_path` parameter is the location of the FMOD for Android library. You should point `library_path` to the contents of `fmodstudioapi(VersionNumber)android/api/core/lib/`, it contains libraries for different CPU architectures possible on Android devices, it also contains cross-platform jar file. We expect a directory structure with at least files like this: |
| 26 |
|
| 27 |
---- |
| 28 |
fmodstudioapi(VersionNumber)android/ |
| 29 |
api/ |
| 30 |
core/ |
| 31 |
lib/ <- point the library_path to this directory |
| 32 |
fmod.jar |
| 33 |
arm64-v8a/ |
| 34 |
libfmod.so |
| 35 |
libfmodL.so |
| 36 |
armeabi-v7a/ |
| 37 |
libfmod.so |
| 38 |
libfmodL.so |
| 39 |
---- |
| 40 |
|
| 41 |
### Use FMOD sound backend from Pascal |
| 42 |
|
| 43 |
Use `CastleFMODSoundBackend` unit and call `UseFMODSoundBackend`. |
| 44 |
|
| 45 |
That's it, now all our sound API (see https://castle-engine.io/manual_sound.php[manual about sound]) uses FMOD under the hood. |
| 46 |
|
| 47 |
See https://castle-engine.io/fmod[FMOD docs] for more details. |