Cross-platform Java wrapper for the FMOD audio engine using JNA.
The goal of this project is to be an idiomatic, high-performance Java wrapper for the FMOD audio engine, leveraging JNA to provide a seamless interface to the FMOD Core API.
- Audio playback and streaming
- Real-time DSP effects (Chorus, Compressor, EQ, FFT, etc.)
- Channel and ChannelGroup management
- 3D Audio (structure-wise, not code wise)
- Plugin system (structure-wise, not code wise)
- Memory management (cases which make NPEs or cause potential VM crashes can easily be made)
- Recording functionality
- Geometry-based occlusion
- Advanced 3D positioning
<dependency>
<groupId>io.github.big-lip-bob</groupId>
<artifactId>fmod-jna</artifactId>
<version>0.0.1</version>
</dependency>
This package does NOT include the FMOD native libraries. You must obtain them separately from FMOD.com and place them in the correct directory structure.
The FMOD native libraries must be placed 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.dll
if 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());
}
- Java: 24
- JNA: 5.16.0 (included as a dependency)
- FMOD Core API: 2.03.06 or compatible
- Windows (x86, x64)
- Linux (x64)
- macOS (Intel x64, Apple Silicon)
This wrapper is released under the MIT License. However, please note that FMOD itself has its own licensing terms which you must comply with separately.
- Issues: GitHub Issues
- FMOD Documentation: FMOD Docs
- FMOD Support: FMOD Support
- Firelight Technologies for creating the excellent FMOD audio engine
- The JNA project for making native library access possible in Java