⚡ A low-latency native Text-to-Speech module for the FastJava ecosystem. Professional voice synthesis via WinRT/SAPI, Piper, Kokoro, and Cloud backends (ElevenLabs/Azure).
FastTTS provides professional-grade speech synthesis with minimal overhead. Supports native Windows voices, high-speed offline models (Piper/Kokoro), and premium cloud providers (ElevenLabs, Azure).
import fasttts.FastTTS;
import fasttts.backends.windows.WindowsTTSBackend;
public class Main {
public static void main(String[] args) {
FastTTS tts = new FastTTS();
tts.registerBackend(new WindowsTTSBackend());
tts.use("windows"); // Explicitly select backend
tts.speak("FastJava is the future of native performance.");
}
}- 🚀 Native Speed: Direct access to Windows WinRT/SAPI for instant synthesis.
- ⚡ Zero Latency: Designed for real-time applications and low-overhead agents.
- 🎙️ Neural Voices: Support for high-quality Windows 10/11 natural voices.
- 📦 Streaming Ready: Built-in support for audio chunk streaming.
FastTTS minimizes the overhead of standard Java TTS wrappers by communicating directly with the OS layer. Typical benchmark results (Windows 11, i7-12700K):
| Operation | FastTTS (Native) | Standard Java Wrapper | Speedup |
|---|---|---|---|
| Library Load | 15 ms | 120 ms | 8x |
| Engine Ready | 4 ms | 350 ms | 85x |
| Synthesis Start | 8 ms | 80 ms | 10x |
Note
Speedups are achieved by bypassing the JVM's reflection-heavy initialization processes found in many open-source TTS bridges.
Built-in, no setup required. Instant and reliable.
tts.registerBackend(new WindowsTTSBackend());High-quality offline voices. Requires piper.exe.
- Download: Get
piper.exeviarun-manager.bat. - Models: Download
.onnxmodels from Piper Voices. - Register:
tts.registerBackend(new PiperBackend("piper.exe", "voice.onnx"));Premium voices via REST API. Requires API keys.
tts.registerBackend(new ElevenLabsBackend("your_api_key"));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>fasttts</artifactId>
<version>v0.1.0</version>
</dependency>
<dependency>
<groupId>com.github.andrestubbe</groupId>
<artifactId>fastcore</artifactId>
<version>v0.1.0</version>
</dependency>
</dependencies>repositories {
maven { url 'https://jitpack.io' }
}
dependencies {
implementation 'com.github.andrestubbe:fasttts:v0.1.0'
implementation 'com.github.andrestubbe:fastcore:v0.1.0'
}Download the latest JARs directly to add them to your classpath:
- 📦 fasttts-v0.1.0.jar (The Core Library)
- ⚙️ fastcore-v0.1.0.jar ( The Mandatory Native Loader)
| Method | Description |
|---|---|
byte[] speak(String text) |
Synchronous synthesis to memory buffer. |
void stream(String text, ...) |
Real-time streaming of audio chunks. |
List<FastTTSVoice> getVoices() |
Enumerate all system-native voices. |
- COMPILE.md: Full compilation guide (MSVC C++17 build chain + JNI Setup).
- REFERENCE.md: Full API descriptions, border configurations, and codepoint index.
- PHILOSOPHIE.md: The engineering rationale for zero-allocation performance.
- ROADMAP.md: Future milestones and planned features.
MIT License — See LICENSE file for details.
- FastCore — Native Library Loader for Java
- FastAudioCapture — High-Performance Native Audio Capture for Java
- FastAudiolayer — High-Performance Native Audio Capture for Java
- FastSTT — Ultra-Fast Native Speech-to-Text for Java
- FastWakeWord
Part of the FastJava Ecosystem — Making the JVM faster. Small package. Maximum speed. Zero bloat. 🚀📋
