Skip to content

Repository files navigation

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

StatusLicense: MITJavaPlatformJitPack


⚡ 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 — Exampleimportfastaudioprocess.FastAudioProcess;
publicclassDemo {
publicstaticvoidmain(String[] args) throwsException {
byte[] rawPcmData = newbyte[16000]; // 16-bit PCM bytesfloatrmsVolume = 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:

OperationStandard JavaFastAudioProcess (SIMD / JNI)Speedup
RMS Calculation4.8 ms0.4 ms12x
Dynamic Pitch Shifting8.2 ms0.6 ms13.6x

API Quick Reference

MethodDescriptionPath
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

PlatformStatus
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‑precision native timing for Java — direct DWM VSync synchronization and 1 ms multimedia timers via Win32 APIs, eliminating Thread.sleep jitter and enabling perfectly paced render loops for FastJava applications.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages