# Text to speech in Java, offline

Updated 2026-10-24

Java never got speech synthesis in the standard library, so projects reach for older engines such as FreeTTS or MaryTTS, which sound robotic next to neural voices, or for a cloud SDK that bills per character and sees every text.

This guide shows a modern alternative: the free SuperClonica engine as a local HTTP server, called with the HttpClient built into Java 11 and newer. You get natural voices, WAV files you keep and no fee per request, on any platform.

## Ways to speak from Java

The engine does not run inside the JVM; your Java code talks to it over HTTP, like to any other service.

- FreeTTS and MaryTTS: pure Java and offline, but robotic compared with neural voices.
- Cloud SDKs: natural voices, but an account, a key, a bill per character and your text on their servers.
- SuperClonica: a local HTTP server with natural, character and custom voices, offline, wherever Docker runs.
- It speaks 31 languages; Chinese is not supported yet.

## Hear the voices free online

Before you write code, open the page of any voice, type a line of 30 to 100 characters, choose the language and press Voice it. In a few seconds you hear the voice your app could have, with no account.

## Start the speech server

An NVIDIA graphics card makes it faster with the cuda image, but it is not required.

- Start the server on any CPU: docker run -d -p 8000:8000 -v superclonica-models:/models superclonica/superclonica:cpu.
- The first start downloads the Supertonic 3 model, about 385 MB, into the volume; GET /health tells you when it is ready.
- POST /synthesize takes JSON with text, voice, lang, seed and normalize, and answers with a 16-bit mono WAV.
- voice is a stock name from M1 to M5 and F1 to F5, or the JSON content of a voice file.

## Call it from Java

With java.net.http, java.net.URI and java.nio.file, a request takes a few lines in Java 11 or newer: var voice = Files.readString(Path.of("voice.json")); var json = "{\"text\": \"Hello from Java!\", \"lang\": \"en\", \"seed\": 7, \"voice\": " + voice + "}"; var request = HttpRequest.newBuilder(URI.create("http://localhost:8000/synthesize")).header("Content-Type", "application/json").POST(HttpRequest.BodyPublishers.ofString(json)).build(); HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofFile(Path.of("hello.wav"))); The response is written straight to a WAV file. For a stock voice, send "voice": "F1" instead of the file content. The same text, voice and seed always give the same audio, so cache files for phrases that repeat; a JSON library such as Jackson keeps the request tidy in larger projects.

## Production habits

Reuse one HttpClient and set a timeout on requests. Do not expose port 8000 to the internet as it is: set SUPERCLONICA_API_KEY and send it as a Bearer token, or keep the server on a private network. Run more copies of the model with SUPERCLONICA_LANES if many requests arrive at once, and measure on your hardware: in our tests a short phrase took 0.12 s on an RTX 5070 Ti and 0.43 s on four CPU threads.

## More guides

- [How to convert text to speech offline on your computer](https://superclonica.com/en/guides/offline-text-to-speech)
- [Voice cloning: how to get a voice that sounds like a recording](https://superclonica.com/en/guides/voice-cloning)
- [The best free text-to-speech models for local use in 2026](https://superclonica.com/en/guides/best-free-tts-models)
- [Text to speech for videos, audiobooks, games and apps](https://superclonica.com/en/guides/text-to-speech-for-videos)
- [Supertonic 3 voices: where to get custom voices and how to use them](https://superclonica.com/en/guides/supertonic-3-voices)
- [Text to speech in Python: offline, free and with natural voices](https://superclonica.com/en/guides/python-text-to-speech)
- [Text to speech in Google Colab, without installing anything](https://superclonica.com/en/guides/google-colab-text-to-speech)
- [Text to speech in JavaScript and Node.js](https://superclonica.com/en/guides/javascript-text-to-speech)
- [Text to speech in C# and.NET, offline](https://superclonica.com/en/guides/csharp-text-to-speech)
- [Unity text to speech: voice lines and runtime speech](https://superclonica.com/en/guides/unity-text-to-speech)
- [Godot text to speech: voice lines and runtime speech](https://superclonica.com/en/guides/godot-text-to-speech)
- [Text to speech in PHP and WordPress, offline](https://superclonica.com/en/guides/php-text-to-speech)
- [Text to speech in Go, offline](https://superclonica.com/en/guides/go-text-to-speech)
- [Text to speech in Rust, offline](https://superclonica.com/en/guides/rust-text-to-speech)
- [Self-hosted text-to-speech API in Docker](https://superclonica.com/en/guides/text-to-speech-api-docker)
- [Text to speech for local LLMs and chatbots](https://superclonica.com/en/guides/local-llm-text-to-speech)
- [Bulk text to speech from a spreadsheet](https://superclonica.com/en/guides/bulk-text-to-speech)
- [n8n text to speech with a self-hosted voice](https://superclonica.com/en/guides/n8n-text-to-speech)
- [Text to speech in character voices: voice any line as your favourite character](https://superclonica.com/en/guides/character-voice-generator)
- [Free unlimited text to speech without sign-up: run it on your own computer](https://superclonica.com/en/guides/free-unlimited-text-to-speech)
- [Narrator voice generator: narration for videos, audiobooks and podcasts](https://superclonica.com/en/guides/narrator-voice-generator)
- [Child voice text to speech: kid and teenager AI voices](https://superclonica.com/en/guides/child-voice-text-to-speech)
- [Anime voice generator: text to speech in anime character voices](https://superclonica.com/en/guides/anime-voice-generator)
- [Manga and manhwa dub voices with AI](https://superclonica.com/en/guides/manga-dub-voices)
- [Text to speech voice for VTubers](https://superclonica.com/en/guides/vtuber-text-to-speech)
- [Levi Ackerman TTS: make him say anything](https://superclonica.com/en/guides/levi-ackerman-voice)
- [Light Yagami TTS: an inner monologue in his voice](https://superclonica.com/en/guides/light-yagami-voice)
- [Rei Ayanami TTS: a quiet voice for your lines](https://superclonica.com/en/guides/rei-ayanami-voice)
- [Text to speech in 31 languages: one voice for every language](https://superclonica.com/en/guides/text-to-speech-languages)
- [Female voice text to speech: natural AI female voices](https://superclonica.com/en/guides/female-voice-text-to-speech)
- [Male voice text to speech: deep and natural AI male voices](https://superclonica.com/en/guides/male-voice-text-to-speech)
- [Realistic text to speech: AI voices that sound human](https://superclonica.com/en/guides/realistic-text-to-speech)
- [AI voice generator: turn text into speech with ready AI voices](https://superclonica.com/en/guides/ai-voice-generator)
- [Text to speech reader: listen to books, PDFs and articles](https://superclonica.com/en/guides/text-to-speech-reader)
- [TikTok voice generator: voices for TikTok, Shorts and Reels](https://superclonica.com/en/guides/tiktok-voice-generator)
- [CapCut text to speech: add character voices to your videos](https://superclonica.com/en/guides/capcut-text-to-speech)
- [Dota 2 hero voices: make any hero say your line](https://superclonica.com/en/guides/dota-2-voice-generator)
- [Cartoon voice generator: make a cartoon character say your text](https://superclonica.com/en/guides/cartoon-voice-generator)
- [Scratch voices for animatics and storyboards](https://superclonica.com/en/guides/animatic-scratch-voice)
- [Jarvis voice generator: your text in a Jarvis-style AI voice](https://superclonica.com/en/guides/jarvis-voice-generator)
- [Darth Vader voice generator: Star Wars voices for your text](https://superclonica.com/en/guides/darth-vader-voice-generator)
- [Train your own TTS voice on your NVIDIA GPU](https://superclonica.com/en/guides/train-tts-voice)
- [Emotional text to speech: how to make an AI voice sound expressive](https://superclonica.com/en/guides/emotional-text-to-speech)
- [Hindi text to speech: AI voices that read Hindi](https://superclonica.com/en/guides/hindi-text-to-speech)
- [Spanish text to speech: AI voices that read Spanish](https://superclonica.com/en/guides/spanish-text-to-speech)
- [Japanese text to speech: AI voices that read Japanese](https://superclonica.com/en/guides/japanese-text-to-speech)
- [A VOICEVOX alternative for multilingual videos](https://superclonica.com/en/guides/voicevox-alternative)
- [Russian text to speech with voices recorded in Russian](https://superclonica.com/en/guides/russian-text-to-speech)
- [Portuguese text to speech: AI voices that read Portuguese](https://superclonica.com/en/guides/portuguese-text-to-speech)
- [German text to speech: AI voices that read German](https://superclonica.com/en/guides/german-text-to-speech)
- [French text to speech: AI voices that read French](https://superclonica.com/en/guides/french-text-to-speech)
- [Korean text to speech: AI voices that read Korean](https://superclonica.com/en/guides/korean-text-to-speech)
- [English text to speech: AI voices that read English](https://superclonica.com/en/guides/english-text-to-speech)
- [Arabic text to speech: AI voices that read Arabic](https://superclonica.com/en/guides/arabic-text-to-speech)
- [Geralt voice generator: Witcher voices for your text](https://superclonica.com/en/guides/witcher-voice-generator)
- [GTA 5 voice generator: Trevor, Franklin and Lester say your text](https://superclonica.com/en/guides/gta-5-voice-generator)
- [Police radio dispatch voice for roleplay](https://superclonica.com/en/guides/police-radio-dispatch-voice)
- [How to make an audiobook with an AI voice](https://superclonica.com/en/guides/audiobook-ai-voice)
- [Text to speech for game development: NPC voices without a studio](https://superclonica.com/en/guides/text-to-speech-for-games)
- [Italian text to speech: AI voices that read Italian](https://superclonica.com/en/guides/italian-text-to-speech)
- [Polish text to speech: AI voices that read Polish](https://superclonica.com/en/guides/polish-text-to-speech)
- [Turkish text to speech: AI voices that read Turkish](https://superclonica.com/en/guides/turkish-text-to-speech)
- [Ukrainian text to speech: AI voices that read Ukrainian](https://superclonica.com/en/guides/ukrainian-text-to-speech)
- [Vietnamese text to speech: AI voices that read Vietnamese](https://superclonica.com/en/guides/vietnamese-text-to-speech)
- [Indonesian text to speech: AI voices that read Indonesian](https://superclonica.com/en/guides/indonesian-text-to-speech)
- [Meme voice generator: funny voices for your memes](https://superclonica.com/en/guides/meme-voice-generator)
- [Italian brainrot voice generator for memes](https://superclonica.com/en/guides/italian-brainrot-voice)
- [Discord text to speech with custom AI voices](https://superclonica.com/en/guides/discord-text-to-speech)
- [Telegram bot voice messages with AI voices](https://superclonica.com/en/guides/telegram-bot-voice-messages)
- [VHS voice-over dub: the 90s one-voice translation style](https://superclonica.com/en/guides/vhs-voice-over-dub)
- [Stream alert voices: character voices for follows, subs and donations](https://superclonica.com/en/guides/stream-alert-voices)
- [Twitch chat TTS with character voices](https://superclonica.com/en/guides/twitch-chat-tts)
- [Smash Bros. announcer voice for streams and memes](https://superclonica.com/en/guides/smash-bros-announcer-voice)
- [Dutch text to speech: AI voices that read Dutch](https://superclonica.com/en/guides/dutch-text-to-speech)
- [Swedish text to speech: AI voices that read Swedish](https://superclonica.com/en/guides/swedish-text-to-speech)
- [Czech text to speech: AI voices that read Czech](https://superclonica.com/en/guides/czech-text-to-speech)
- [Greek text to speech: AI voices that read Greek](https://superclonica.com/en/guides/greek-text-to-speech)
- [Romanian text to speech: AI voices that read Romanian](https://superclonica.com/en/guides/romanian-text-to-speech)
- [Hungarian text to speech: AI voices that read Hungarian](https://superclonica.com/en/guides/hungarian-text-to-speech)
- [Danish text to speech: AI voices that read Danish](https://superclonica.com/en/guides/danish-text-to-speech)
- [Finnish text to speech: AI voices that read Finnish](https://superclonica.com/en/guides/finnish-text-to-speech)
- [Bulgarian text to speech: AI voices that read Bulgarian](https://superclonica.com/en/guides/bulgarian-text-to-speech)
- [Croatian text to speech: AI voices that read Croatian](https://superclonica.com/en/guides/croatian-text-to-speech)
- [Slovak text to speech: AI voices that read Slovak](https://superclonica.com/en/guides/slovak-text-to-speech)
- [Slovenian text to speech: AI voices that read Slovenian](https://superclonica.com/en/guides/slovenian-text-to-speech)
- [Estonian text to speech: AI voices that read Estonian](https://superclonica.com/en/guides/estonian-text-to-speech)
- [Latvian text to speech: AI voices that read Latvian](https://superclonica.com/en/guides/latvian-text-to-speech)
- [Lithuanian text to speech: AI voices that read Lithuanian](https://superclonica.com/en/guides/lithuanian-text-to-speech)
- [Scary voice generator: horror, villain and demon voices for your text](https://superclonica.com/en/guides/scary-voice-generator)
- [Pennywise TTS: make the clown say anything](https://superclonica.com/en/guides/pennywise-voice-generator)
- [Cute voice text to speech: anime girl, kawaii and cartoon voices](https://superclonica.com/en/guides/cute-voice-text-to-speech)
- [Old man voice generator: grandpa, wizard and elder voices](https://superclonica.com/en/guides/old-man-voice-generator)
- [Deep voice generator: low AI voices for text to speech](https://superclonica.com/en/guides/deep-voice-generator)
- [SpongeBob text to speech: make him say anything](https://superclonica.com/en/guides/spongebob-voice-generator)
- [Batman text to speech: make him say anything](https://superclonica.com/en/guides/batman-voice-generator)
- [The Boys voice generator: Homelander and Billy Butcher](https://superclonica.com/en/guides/the-boys-voice-generator)
- [Lord of the Rings voice generator: Gollum and Saruman](https://superclonica.com/en/guides/lord-of-the-rings-voice-generator)
- [MiSide Mita voice for fan videos and memes](https://superclonica.com/en/guides/miside-mita-voice)
- [Harry Potter voice generator: Severus Snape](https://superclonica.com/en/guides/harry-potter-voice-generator)
- [Resident Evil voice generator: Leon Kennedy](https://superclonica.com/en/guides/resident-evil-voice-generator)
- [My Little Pony voice generator: Twilight Sparkle](https://superclonica.com/en/guides/my-little-pony-voice-generator)
- [Text to speech for presentations: narrate your slides](https://superclonica.com/en/guides/text-to-speech-for-presentations)
- [Rick and Morty voice generator: AI text to speech](https://superclonica.com/en/guides/rick-and-morty-voice-generator)
- [AI podcast voice: intros, ad reads and whole episodes](https://superclonica.com/en/guides/ai-podcast-voice)
- [Russian accent voice generator: English with a Russian accent](https://superclonica.com/en/guides/russian-accent-voice-generator)
- [News anchor voice generator: an AI voice that reads the news](https://superclonica.com/en/guides/news-anchor-voice-generator)
- [Bedtime story AI voice: a calm narrator for fairy tales](https://superclonica.com/en/guides/bedtime-story-ai-voice)
- [AI voice changer or text to speech: which one you need](https://superclonica.com/en/guides/voice-changer-vs-text-to-speech)
- [Linux text to speech: natural offline TTS from the terminal](https://superclonica.com/en/guides/text-to-speech-linux)
- [Windows text to speech: natural voices, offline, saved as WAV](https://superclonica.com/en/guides/text-to-speech-windows)
- [Mac text to speech: natural offline voices on macOS](https://superclonica.com/en/guides/text-to-speech-mac)
- [Voicemail greeting generator: a calm AI voice for your phone](https://superclonica.com/en/guides/voicemail-greeting-generator)
- [Announcement voice generator for PA systems](https://superclonica.com/en/guides/announcement-voice-generator)
- [Radio station ID and DJ voice generator](https://superclonica.com/en/guides/radio-station-id-voice)
- [AI voice for museum and tour audio guides](https://superclonica.com/en/guides/audio-guide-voice)
- [Audio description voice for videos](https://superclonica.com/en/guides/audio-description-voice)
- [Escape room voices for briefings, hints and countdowns](https://superclonica.com/en/guides/escape-room-voice)
- [AI voice over for ads: radio spots, video ads and promos](https://superclonica.com/en/guides/ai-voice-over-for-ads)
- [Free text to speech for commercial use: what is actually allowed](https://superclonica.com/en/guides/free-text-to-speech-commercial-use)
- [AI voice-over for product demos and software tutorials](https://superclonica.com/en/guides/product-demo-voice-over)
- [AI dubbing: the same voice in 31 languages](https://superclonica.com/en/guides/ai-dubbing-same-voice)
- [SRT to speech: turn subtitles into a voice track](https://superclonica.com/en/guides/srt-to-speech)
- [AI voice for a faceless YouTube channel](https://superclonica.com/en/guides/faceless-youtube-ai-voice)
- [Reddit story voice for TikTok and Shorts](https://superclonica.com/en/guides/reddit-story-voice)
- [True crime narrator voice for YouTube and podcasts](https://superclonica.com/en/guides/true-crime-narrator-voice)
- [Witch voice generator: sorceresses, seers and dark fairies](https://superclonica.com/en/guides/witch-voice-generator)
- [AI voice for e-learning: narrate online courses and training](https://superclonica.com/en/guides/e-learning-ai-voice)
- [Text to speech for language learning](https://superclonica.com/en/guides/text-to-speech-for-language-learning)
- [Text to speech for dyslexia and study](https://superclonica.com/en/guides/text-to-speech-for-dyslexia)
- [Dictation audio generator for teachers](https://superclonica.com/en/guides/dictation-audio-generator)
- [Anki text to speech: audio for every card](https://superclonica.com/en/guides/anki-text-to-speech)
- [Text to speech pauses and pronunciation: control the voice with text](https://superclonica.com/en/guides/text-to-speech-pauses-pronunciation)
- [Text to MP3: save text to speech as an MP3 file](https://superclonica.com/en/guides/text-to-mp3)
- [Santa voice generator: Christmas greetings in a warm old voice](https://superclonica.com/en/guides/santa-voice-generator)
- [Happy birthday voice message from a character](https://superclonica.com/en/guides/birthday-voice-message)
- [D&D narrator voice: AI voices for tabletop RPGs](https://superclonica.com/en/guides/dnd-narrator-voice)
- [AI voice acting for visual novels and Ren’Py games](https://superclonica.com/en/guides/visual-novel-ai-voice)
- [AI voices for audio drama and radio plays](https://superclonica.com/en/guides/audio-drama-ai-voices)
- [A Speechify alternative that works offline](https://superclonica.com/en/guides/speechify-alternative)
- [A NaturalReader alternative that works offline](https://superclonica.com/en/guides/naturalreader-alternative)
- [A TTSMaker alternative without limits, offline](https://superclonica.com/en/guides/ttsmaker-alternative)
- [A TTSMP3 alternative with unique voices and no length limit](https://superclonica.com/en/guides/ttsmp3-alternative)
- [A Murf AI alternative for offline voice-over](https://superclonica.com/en/guides/murf-ai-alternative)
- [A Play.ht alternative that runs offline](https://superclonica.com/en/guides/playht-alternative)
- [A FakeYou alternative: character voices that run offline](https://superclonica.com/en/guides/fakeyou-alternative)
- [An offline alternative to Google Cloud Text-to-Speech](https://superclonica.com/en/guides/google-text-to-speech-alternative)
- [An offline alternative to OpenAI text to speech](https://superclonica.com/en/guides/openai-tts-alternative)
- [An alternative to Bark and Tortoise TTS that runs on a CPU](https://superclonica.com/en/guides/bark-tortoise-tts-alternative)
- [A GPT-SoVITS alternative for 31 languages](https://superclonica.com/en/guides/gpt-sovits-alternative)
- [An alternative to Dia, Orpheus and Sesame CSM that runs on a CPU](https://superclonica.com/en/guides/dia-orpheus-csm-alternative)
- [An alternative to MeloTTS and OpenVoice in 31 languages](https://superclonica.com/en/guides/melotts-openvoice-alternative)
- [An edge-tts alternative that works offline](https://superclonica.com/en/guides/edge-tts-alternative)
- [A gTTS alternative with natural voices, offline](https://superclonica.com/en/guides/gtts-alternative)
- [A pyttsx3 alternative with natural voices](https://superclonica.com/en/guides/pyttsx3-alternative)
- [A Balabolka alternative with natural neural voices](https://superclonica.com/en/guides/balabolka-alternative)
- [PDF to audio: convert a PDF to MP3 with natural voices](https://superclonica.com/en/guides/pdf-to-audio)
- [EPUB to audiobook: convert an e-book to MP3](https://superclonica.com/en/guides/epub-to-audiobook)
- [Word document to audio: turn Word and Google Docs into MP3](https://superclonica.com/en/guides/word-document-to-audio)
- [Article to audio: listen versions for blogs and news sites](https://superclonica.com/en/guides/article-to-audio)
- [Meditation voice generator: calm AI voices for guided sessions](https://superclonica.com/en/guides/meditation-voice-generator)
- [AI voice cues for workouts and fitness apps](https://superclonica.com/en/guides/workout-voice-cues)

## Text to speech and comparisons

- [Text-to-speech that runs on your own computer](https://superclonica.com/en/text-to-speech)
- [Supertonic vs SuperClonica: same model, faster and cleaner](https://superclonica.com/en/compare/supertonic)
- [Fish Audio and Fish Speech vs SuperClonica](https://superclonica.com/en/compare/fish-audio)
- [OmniVoice vs SuperClonica: more languages or more speed](https://superclonica.com/en/compare/omnivoice)
- [Qwen3-TTS vs SuperClonica for local text-to-speech](https://superclonica.com/en/compare/qwen3-tts)
- [VoxCPM 2 vs SuperClonica: studio sound or CPU speed](https://superclonica.com/en/compare/voxcpm)
- [F5-TTS vs SuperClonica: zero-shot cloning or fast CPU speech](https://superclonica.com/en/compare/f5-tts)
- [An offline alternative to ElevenLabs](https://superclonica.com/en/compare/elevenlabs)
- [Kokoro TTS vs SuperClonica: two small models for local speech](https://superclonica.com/en/compare/kokoro)
- [Piper TTS vs SuperClonica: tiny devices or custom voices](https://superclonica.com/en/compare/piper)
- [Coqui XTTS-v2 vs SuperClonica: a Coqui TTS alternative](https://superclonica.com/en/compare/xtts)
- [Chatterbox TTS vs SuperClonica: instant cloning or a trained voice file](https://superclonica.com/en/compare/chatterbox)

## Frequently asked questions

### Can it run inside my Java application?

No. It runs as a separate local server, and your application calls it over HTTP with the built-in HttpClient.

### Does it work on Android?

Not on the device itself. An Android app can call the server over the network, or ship audio voiced in advance.

### Does it need the internet?

No. After the one-time model download, the server works offline.

### What does it cost?

The engine, the Docker image and the ten stock voices are free; catalog voices are bought once.

- [Browse voices](https://superclonica.com/en/explore)
- [Install the SuperClonica engine](https://superclonica.com/en/superclonica)

## Sources

- [Supertonic 3 model card](https://huggingface.co/supertone-oss-archive/supertonic-3)
- [SuperClonica engine on PyPI](https://pypi.org/project/superclonica-cpu/)
- [SuperClonica](https://superclonica.com/en/)
- [AI voice catalog for text to speech](https://superclonica.com/en/explore)
- [Custom voice commissions for Supertonic 3](https://superclonica.com/en/requests)
- [How it works: voices, local speech, training](https://superclonica.com/en/guide)
- [Install the faster Supertonic 3 engine](https://superclonica.com/en/superclonica)
- [About us: speech synthesis enthusiasts](https://superclonica.com/en/about)
- [Contacts, support and voice complaints](https://superclonica.com/en/contacts)
- [Privacy policy: what data we keep](https://superclonica.com/en/privacy)
- [Terms of use: rules for buyers and authors](https://superclonica.com/en/terms)
- [Text to speech](https://superclonica.com/en/text-to-speech)
