โก Hardware-accelerated, zero-shot AI voice cloning and speech-to-speech conversion for the FastJava ecosystem.
FastVoice enables high-fidelity voice cloning in seconds without training heavy neural models. It extracts compact mathematical speaker embeddings (~2 KB) from short reference audio samples (3โ10s) and performs instant multi-engine voice cloning and conversion for Java applications.
import fastvoice.FastVoice;
import fastvoice.VoiceProfile;
import java.nio.file.Files;
import java.nio.file.Path;
public class Demo {
public static void main(String[] args) throws Exception {
// 1. Create a cloned voice profile from a 5s audio sample
byte[] referenceAudioWav = Files.readAllBytes(Path.of("sample.wav"));
VoiceProfile profile = FastVoice.createProfile("SpeakerName", "f5tts", referenceAudioWav);
// 2. Export profile to a target directory
Path exportDir = Path.of("voices", "clones");
profile.exportToDirectory(exportDir);
System.out.println("Voice cloned and exported: " + profile.name());
}
}- Quick Start
- Why FastVoice?
- Key Features
- Real-World Use Cases
- Architecture Overview
- Performance Benchmarks
- API Quick Reference
- Technical Demos & Benchmarks
- Installation
- Documentation
- Platform Support
- License
- Related Projects
Traditional voice cloning workflows require extensive dataset curation, hours of GPU fine-tuning, and large model distribution packages. FastVoice provides:
- Zero-Shot Speaker Conditioning: Clone timbre from a 3โ10s audio sample without fine-tuning weights.
- Ultra-Lightweight Voice Profiles: Acoustic speaker embeddings are stored as compact binary vectors (
~2 KB), allowing thousands of voices to be indexed with minimal storage. - Decoupled Architecture: Clean programmatic Java API separating the voice profile format from the underlying inference engine (F5-TTS, CosyVoice, XTTS).
- Native Ecosystem Integration: Backed by
FastCoreand designed to pair seamlessly withFastTTS,FastAudioProcess, andFastAudioCapture.
| Feature | Legacy Voice Training | Heavy Python Wrappers | FastVoice |
|---|---|---|---|
| Training Requirement | Hours of GPU fine-tuning | Varies | Zero-Shot (3โ10s reference audio) |
| Profile Storage | 100 MB โ 2 GB per voice | Varies | ~2 KB per voice profile |
| Runtime Overhead | High (PyTorch/CUDA checkpoints) | Heavy process spawning | Pure Java 21+ API & Native FastCore |
| Voice Conversion (STS) | Separate complex pipelines | External scripts | Built-in FastVoice.convert() API |
| Downstream Usability | Custom inference scripts | Fragile CLI pipes | Single-line export & synthesis |
- โก Zero-Shot One-Click Cloning: No model training or GPU hours required. Clones timbre from 3โ10s of audio in 1โ2 seconds.
- ๐ชถ Ultra-Compact Profiles: Stores embeddings as tiny binary vectors (
~2 KB), allowing thousands of voices without disk bloat. - ๐ Speech-to-Speech Conversion: Transform spoken recordings into any target profile's voice with prosody preservation.
- ๐ Seamless Ecosystem Interop: Clean, decoupled Java API designed for integration with FastJava audio and speech pipelines.
- ๐๏ธ Personalized Voice Assistants: Generate personalized voice responses using the user's or designated speaker's timbre in real time.
- ๐ฎ Game Character Dialogue & NPCs: Synthesize dynamic speech for dozens of characters using lightweight zero-shot profiles instead of separate multi-gigabyte models.
- ๐ฌ Video Dubbing & Localization: Convert spoken dialogue into different languages while preserving the original actor's vocal characteristics via Speech-to-Speech conversion.
- ๐ง Accessibility & Voice Preservation: Archive natural voice profiles from short recordings for vocal restoration and text-to-speech assistive devices.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Short Reference Audio (WAV) โ
โ (3โ10s Clean Voice Sample) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ FastAudioProcess (DSP Cleaning)
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ FastVoice โ
โ โข Instant Acoustic Embedding Extraction โ
โ โข Zero-Shot Speaker Conditioning โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Lightweight Profile (~2 KB)
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Voice Profile Storage โ
โ โข voice.json โข embedding.bin โข reference.wav โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Programmatic Java API
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Downstream Application โ
โ (Real-time Synthesis & Audio Generation) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
FastVoice is benchmarked using OpenJDK JMH to guarantee sub-microsecond profile instantiation and minimal I/O overhead:
| Benchmark / Operation | Throughput (ops/ms) | Ops per Second | Latency |
|---|---|---|---|
benchmarkProfileCreation (Metadata + VoiceProfile Record) |
~147,902 ops/ms | > 147 Million | < 7 ns |
benchmarkProfileExport (Disk I/O: JSON + Binary Vector + WAV) |
~0.84 ops/ms | ~840 ops/s | ~1.19 ms |
Measured on Windows 11 (x64), JDK 21.0.12.1. Pure Java 21+ record instantiation with zero GC allocation overhead.
| Class / Record | Responsibility | Key Methods | Reference |
|---|---|---|---|
FastVoice |
Central facade for backend registration and synthesis | createProfile(), synthesize(), convert(), registerBackend() |
Reference |
VoiceProfile |
Immutable container for embeddings and reference audio | exportToDirectory(), embedding(), referenceWav() |
Reference |
VoiceCloner |
Interface for cloning engine implementations | extractEmbedding(), cloneAndSynthesize(), convertVoice() |
Reference |
For complete method signatures and details, refer to docs/REFERENCE.md.
| Case | Java Example | Launcher | Description |
|---|---|---|---|
| Showcase Demo | Demo.java | run-demo.bat |
Creates a zero-shot voice profile from reference audio, verifies speaker metadata, and exports it to disk. |
| JMH Microbenchmark Suite | Benchmark.java | run-benchmark.bat |
Formal OpenJDK JMH throughput measurements across profile instantiation and disk export. |
Add JitPack to your <repositories> and include the dependency in your pom.xml:
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
<dependencies>
<!-- FastVoice Engine -->
<dependency>
<groupId>com.github.andrestubbe</groupId>
<artifactId>FastVoice</artifactId>
<version>0.1.0</version>
</dependency>
<!-- FastAudioProcess (DSP Denoise & Normalization) -->
<dependency>
<groupId>com.github.andrestubbe</groupId>
<artifactId>FastAudioProcess</artifactId>
<version>0.1.7</version>
</dependency>
<!-- FastCore (Unified Native Platform Loader) -->
<dependency>
<groupId>com.github.andrestubbe</groupId>
<artifactId>FastCore</artifactId>
<version>0.1.0</version>
</dependency>
</dependencies>repositories {
maven { url 'https://jitpack.io' }
}
dependencies {
implementation 'com.github.andrestubbe:FastVoice:0.1.0'
implementation 'com.github.andrestubbe:FastAudioProcess:0.1.7'
implementation 'com.github.andrestubbe:FastCore:0.1.0'
}Download the pre-compiled standalone JAR directly from GitHub Releases:
- ๐ฆ FastVoice-0.1.0.jar
- CHANGELOG.md: Detailed version history and updates.
- REFERENCE.md: Full API documentation and method contracts.
- PHILOSOPHY.md: Zero-shot speaker conditioning design and architecture.
- COMPILE.md: Build instructions and Maven commands.
- ROADMAP.md: Upcoming engine backends and streaming conversions.
| Platform | Architecture | Status | Notes |
|---|---|---|---|
| Windows 10 / 11 | x64 |
โ Fully Supported | Native hardware acceleration via FastCore / FastSIMD |
| Linux | x64 / AArch64 |
๐ง Planned | Native bindings in development |
| macOS (Sonoma+) | Apple Silicon / x64 |
๐ง Planned | Native bindings in development |
MIT License โ See LICENSE file for details.
- FastTTS โ Unified, zero-bloat text-to-speech backend orchestration
- FastSTT โ High-throughput local speech-to-text recognition
- FastVAD โ Ultra-fast real-time Voice Activity Detection (Silero-ONNX & WebRTC)
- FastAudioCapture โ Zero-copy WASAPI audio loopback & microphone capture
- FastAudioProcess โ Zero-allocation audio DSP, resamplers, and timeline mixing
- FastAudioPlayer โ Ultra low-latency WASAPI and DirectSound audio playback engine
- FastCore โ Native library loader, FFM gateway, and platform abstraction
- FastSIMD โ Vector hardware acceleration for high-throughput math and DSP
Part of the FastJava Ecosystem โ Making the JVM faster. Small package. Maximum speed. Zero bloat. ๐๐