Idiomatic, high-performance Java interface to FMOD Core API using JNA
Report Bug
Table of Contents
FMOD-JNA is a cross-platform Java wrapper for the FMOD audio engine, leveraging JNA to provide a seamless, idiomatic interface to the FMOD Core API. It enables Java developers to harness FMOD's powerful audio capabilities without dealing with low-level JNI code.
- Audio Playback & Streaming - Load and play audio files with streaming support
- Real-time DSP Effects - Chorus, Compressor, EQ, FFT, and more
- Channel Management - Channel and ChannelGroup control
- Error Handling - Comprehensive exception system with FMOD error codes
- Resource Management - Automatic cleanup with try-with-resources support
- 3D Audio - Structure-wise implementation (code implementation in progress)
- Plugin System - Structure-wise implementation (code implementation in progress)
- Memory Management - Core functionality present (edge cases being addressed)
- Recording Functionality - Audio input/recording capabilities
- Geometry-based Occlusion - Advanced 3D audio occlusion
- Advanced 3D Positioning - Full 3D audio positioning system
Get FMOD-JNA up and running in your Java project.
- Java Development Kit: Java 24 or later
- Build Tool: Maven or Gradle
- FMOD Core API: FMOD native libraries (see FMOD Native Libraries)
-
Add the dependency to your project
Maven:
<dependency> <groupId>io.github.big-lip-bob</groupId> <artifactId>fmod-jna</artifactId> <version>0.0.1</version> </dependency>
Gradle:
implementation 'io.github.big-lip-bob:fmod-jna:0.0.1' -
Obtain and configure FMOD native libraries (see next section)
Important
This repository does NOT include the FMOD native libraries. You must obtain them separately from FMOD.com and configure them properly.
Place the FMOD native libraries in the following directory structure relative to your application's working directory:
your-project/
├── fmod/
│ ├── win-amd64/ # Windows 64-bit
│ │ ├── fmod.dll
│ │ └── vcruntime140_app.dll (if required)
│ ├── win-x86/ # Windows 32-bit
│ │ └── fmod.dll
│ ├── lin-amd64/ # Linux 64-bit
│ │ └── libfmod.so
│ ├── mac-aarch64/ # macOS Apple Silicon
│ │ └── libfmod.dylib
│ └── mac-x86_64/ # macOS Intel
│ └── libfmod.dylib
- Visit FMOD.com and create an account
- Download the FMOD Core API for your target platforms
- Extract the appropriate library files:
- Windows:
fmod.dll(andvcruntime140_app.dllif needed) - Linux:
libfmod.so - macOS:
libfmod.dylib
- Windows:
- Place them in the corresponding platform directories as shown above
Please ensure you comply with FMOD's licensing terms. FMOD is free for non-commercial use, but commercial applications require a license.
import io.github.biglipbob.FMOD.*;
public class BasicExample {
public static void main(String[] args) {
// Create FMOD system
try (FMODSystem system = FMOD.createSystem(32)) {
// Load a sound
FMODSound sound = system.createSound("path/to/your/audio.wav");
// Play the sound
FMODChannel channel = system.playSound(sound, null, false);
// Main loop
while (channel.isPlaying()) {
system.update();
Thread.sleep(10);
}
// Cleanup (automatic with try-with-resources)
}
}
}try {
FMODSound sound = system.createSound("nonexistent.wav");
} catch (FMODException e) {
System.err.println("FMOD Error: " + e.getMessage());
System.err.println("Error Code: " + e.getCode());
}- Windows - x86 (32-bit), x64 (64-bit)
- Linux - x64 (64-bit)
- macOS - Intel x64, Apple Silicon (ARM64)
Important
This wrapper is licensed under the MIT License.
This means:
- ✅ You can use, modify, and distribute this software
- ✅ You can use it for commercial purposes
- ✅ No warranty is provided
⚠️ You must include copyright and license notices
However, FMOD itself has separate licensing terms which you must comply with:
- FMOD is free for non-commercial use
- Commercial applications require an FMOD license from Firelight Technologies
- See FMOD Licensing for complete terms
See LICENSE for the wrapper's license terms.
- Firelight Technologies for creating the excellent FMOD audio engine
- The JNA project for making native library access possible in Java
Made with ❤️