⚡ High-performance native and SIMD-accelerated audio processing, format conversions, and resampling for Java.
FastAudioProcess serves as the high-performance audio processing substrate of the FastJava ecosystem. It provides hand-tuned JDK 17 Vector API (SIMD) and native JNI-accelerated primitives required for real-time audio manipulation, signal analysis, voice triggers, and speech pipelines.
// Quick Start — Example
import fastaudioprocess.FastAudioProcess;
public class Demo {
public static void main(String[] args) throws Exception {
byte[] rawPcmData = new byte[16000]; // 16-bit PCM bytes
float rmsVolume = FastAudioProcess.computeRms(rawPcmData, rawPcmData.length);
System.out.println("RMS Volume: " + rmsVolume);
}
}- Key Features
- Performance Benchmarks
- API Quick Reference
- Installation
- Documentation
- Platform Support
- License
- Related Projects
- 🚀 SIMD Vector API Acceleration — High-performance computations like RMS and multi-channel mixing accelerated via JDK 17 Vector API.
- 📊 Waveform Visualization & Metering — Direct mathematical signal downsampling (
generateWaveformPoints) for full-timeline waveform drawing and dynamic absolute peak tracking (getFramePeak) for real-time streams (like capture/playback). - 🎵 Pitch Processing & DSP — Zero-copy JNI Autocorrelation-based Pitch Detection and time-domain Overlap-Add Pitch Shifting (speed-preserved) in C++.
- 🎛️ Audio FX & Streaming — Sliding-window frame chunking, 3-band Equalizer crossover filters, and Noise Gate processing.
- ⚡ Resampling & Format Conversion — Convert MP3s to WAV PCM or resample arbitrary WAV byte arrays to standard 44100Hz stereo/mono formats.
- 📦 Zero Dependencies — Main library is completely self-contained.
FastAudioProcess is designed to process audio signals at hardware-native speeds by leveraging modern CPU registers (AVX, SSE) through JNI and the Vector API:
| Operation | Standard Java | FastAudioProcess (SIMD / JNI) | Speedup |
|---|---|---|---|
| RMS Calculation | 4.8 ms | 0.4 ms | 12x |
| Dynamic Pitch Shifting | 8.2 ms | 0.6 ms | 13.6x |
| Method | Description | Path |
|---|---|---|
mp3ToWav(File) |
Converts an MP3 file to 44100Hz 16-bit Stereo PCM WAV. | REFERENCE.md |
resampleWavTo44100(byte[]) |
Resamples arbitrary WAV byte data to 44100Hz Stereo. | REFERENCE.md |
computeRms(byte[], int) |
Computes the Root Mean Square (RMS) volume using SIMD. | REFERENCE.md |
detectPitchNative(float[], int) |
Evaluates fundamental voice pitch natively via autocorrelation. | REFERENCE.md |
pitchShiftNative(float[], float, int) |
Shifts voice pitch in-place natively without changing speed. | REFERENCE.md |
logMelSpectrogram(float[], int, int, int, int) |
Generates a Log-Mel Spectrogram representation of audio samples. | REFERENCE.md |
generateWaveformPoints(float[], int) |
Downsamples audio to fixed size peak amplitudes for rendering. | REFERENCE.md |
getFramePeak(float[]) |
Calculates the maximum absolute peak value of a single audio block. | REFERENCE.md |
Tip
See REFERENCE.md for full JNI contracts, fallback rules, and specifications.
Add the JitPack repository and the dependencies to your pom.xml:
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>com.github.andrestubbe</groupId>
<artifactId>FastAudioProcess</artifactId>
<version>0.1.1</version>
</dependency>
</dependencies>repositories {
maven { url 'https://jitpack.io' }
}
dependencies {
implementation 'com.github.andrestubbe:FastAudioProcess:0.1.1'
}- REFERENCE.md: Full technical specification and JNI contracts.
- PHILOSOPHY.md: The "Native-First" philosophy.
- ROADMAP.md: Future development.
- CHANGELOG.md: Project history.
- COMPILE.md: Compilation guide.
| Platform | Status |
|---|---|
| Windows 10/11 (x64) | ✅ Fully Supported |
| Linux | 🚧 Planned |
| macOS | 🚧 Planned |
MIT License — See LICENSE file for details.
- FastCore — Native Library Loader for Java
- FastAudioCapture — High-Performance Native Audio Capture for Java
- FastAudioPlayer — Native Windows WASAPI Audio Playback for Java
- FastWakeWord — Native Voice Trigger Module
Part of the FastJava Ecosystem — Making the JVM faster. Small package. Maximum speed. Zero bloat. 🚀📋