Skip to content

big-lip-bob/fmod-jna

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GitHub Stars License Maven Central Java Version JNA Version

FMOD-JNA

Cross-platform Java wrapper for the FMOD audio engine

Idiomatic, high-performance Java interface to FMOD Core API using JNA

Report Bug

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Platform Support
  5. License
  6. Acknowledgments

About The Project

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.

(back to top)

Features

Fully Implemented

  • 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

Partially Implemented

  • 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)

Not Yet Implemented

  • Recording Functionality - Audio input/recording capabilities
  • Geometry-based Occlusion - Advanced 3D audio occlusion
  • Advanced 3D Positioning - Full 3D audio positioning system

(back to top)

Built With

(back to top)

Getting Started

Get FMOD-JNA up and running in your Java project.

Prerequisites

  • Java Development Kit: Java 24 or later
  • Build Tool: Maven or Gradle
  • FMOD Core API: FMOD native libraries (see FMOD Native Libraries)

(back to top)

Installation

  1. 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'
  2. Obtain and configure FMOD native libraries (see next section)

(back to top)

FMOD Native Libraries

Important

This repository does NOT include the FMOD native libraries. You must obtain them separately from FMOD.com and configure them properly.

Directory Structure

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

Obtaining FMOD Libraries

  1. Visit FMOD.com and create an account
  2. Download the FMOD Core API for your target platforms
  3. Extract the appropriate library files:
    • Windows: fmod.dll (and vcruntime140_app.dll if needed)
    • Linux: libfmod.so
    • macOS: libfmod.dylib
  4. Place them in the corresponding platform directories as shown above

FMOD Licensing

Please ensure you comply with FMOD's licensing terms. FMOD is free for non-commercial use, but commercial applications require a license.

(back to top)

Usage

Basic Audio Playback

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)
        }
    }
}

Error Handling

try {
    FMODSound sound = system.createSound("nonexistent.wav");
} catch (FMODException e) {
    System.err.println("FMOD Error: " + e.getMessage());
    System.err.println("Error Code: " + e.getCode());
}

(back to top)

Platform Support

  • Windows - x86 (32-bit), x64 (64-bit)
  • Linux - x64 (64-bit)
  • macOS - Intel x64, Apple Silicon (ARM64)

(back to top)

License

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.

(back to top)

Acknowledgments

  • Firelight Technologies for creating the excellent FMOD audio engine
  • The JNA project for making native library access possible in Java

(back to top)


Made with ❤️

GitHub · FMOD Documentation

About

Java wrapper for the FMOD audio engine using JNA. Cross-platform and idiomatic.

Topics

Resources

License

Stars

Watchers

Forks

Contributors 2

  •  
  •  

Languages