Skip to content

andrestubbe/FastAudioProcess

Repository files navigation

FastAudioProcess 0.1.1 [ALPHA] — High-Performance Audio Processing and Formant Analysis for Java

Status License: MIT Java Platform JitPack


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

Table of Contents


Key Features

  • 🚀 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.

Performance Benchmarks

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

API Quick Reference

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.


Installation

Option 1: Maven (Recommended)

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>

Option 2: Gradle (via JitPack)

repositories {
    maven { url 'https://jitpack.io' }
}

dependencies {
    implementation 'com.github.andrestubbe:FastAudioProcess:0.1.1'
}

Documentation


Platform Support

Platform Status
Windows 10/11 (x64) ✅ Fully Supported
Linux 🚧 Planned
macOS 🚧 Planned

License

MIT License — See LICENSE file for details.


Related Projects


Part of the FastJava EcosystemMaking the JVM faster. Small package. Maximum speed. Zero bloat. 🚀📋

About

⚡High-Performance, Zero-Allocation native Audio Processing and Formant Analysis for Java

Topics

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors