By using this site, you agree to the Privacy Policy and Terms of Use.
Accept
World of SoftwareWorld of SoftwareWorld of Software
  • News
  • Software
  • Mobile
  • Computing
  • Gaming
  • Videos
  • More
    • Gadget
    • Web Stories
    • Trending
    • Press Release
Search
  • Privacy
  • Terms
  • Advertise
  • Contact
Copyright © All Rights Reserved. World of Software.
Reading: Voices Enables Fast Text-to-Speech for Java Applications
Share
Sign In
Notification Show More
Font ResizerAa
World of SoftwareWorld of Software
Font ResizerAa
  • Software
  • Mobile
  • Computing
  • Gadget
  • Gaming
  • Videos
Search
  • News
  • Software
  • Mobile
  • Computing
  • Gaming
  • Videos
  • More
    • Gadget
    • Web Stories
    • Trending
    • Press Release
Have an existing account? Sign In
Follow US
  • Privacy
  • Terms
  • Advertise
  • Contact
Copyright © All Rights Reserved. World of Software.
World of Software > News > Voices Enables Fast Text-to-Speech for Java Applications
News

Voices Enables Fast Text-to-Speech for Java Applications

News Room
Last updated: 2025/11/05 at 2:13 AM
News Room Published 5 November 2025
Share
Voices Enables Fast Text-to-Speech for Java Applications
SHARE

Voices, an open-source text-to-speech project, was designed for applications running on Java 17 or newer. The library requires no external APIs or manually installed software. Audio files can be generated for various languages based on dictionaries or OpenVoice.

Henry Coles, creator of Voices and Pitest and head of mutation testing at Arcmutate, introduced Voices on Bluesky in September 2025 and the latest version, released in late October 2025, is 0.0.8.

Voices uses ONNX Runtime, a cross-platform AI engine that speeds up training and inference, supporting models from various deep learning frameworks such as TensorFlow and PyTorch. The runtime leverages hardware accelerators whenever possible and supports various hardware and operating system configurations.

Several libraries are required for the examples demonstrated here. The following POM file configuration can be used with Maven:


<!-- The main dependency -->
<dependency>
    <groupId>org.pitest.voices</groupId>
    <artifactId>chorus</artifactId>
    <version>0.0.8</version>
</dependency>
<!-- A prepackaged model -->
<dependency>
    <groupId>org.pitest.voices</groupId>
    <artifactId>alba</artifactId>
    <version>0.0.8</version>
</dependency>
<!-- A dictionary of pronunciations -->
<dependency>
    <groupId>org.pitest.voices</groupId>
    <artifactId>en_uk</artifactId>
    <version>0.0.8</version>
</dependency>
<!-- The runtime for ONNX models -->
<dependency>
    <groupId>com.microsoft.onnxruntime</groupId>
    <artifactId>onnxruntime</artifactId>
    <version>1.22.0</version>
</dependency>

Alternatively, other build tools, such as Gradle, may be used for all examples demonstrated here.

An en_us dictionary may be used instead of the en_uk dictionary by replacing the above dependency. The onnxruntime may be replaced by onnxruntime_gpu for GPU acceleration.The Chorus class can be used to manage voice models and manage resources. It’s advised to use a single Chorus instance in the application due to the expense of loading models. The following example demonstrates the conversion of English text to an InfoQ_English sound file:


ChorusConfig config = chorusConfig(EnUkDictionary.en_uk());
try (Chorus chorus = new Chorus(config)) {

    Voice alba = chorus.voice(Alba.albaMedium());

    Audio audio = alba.say("This is the InfoQ article about the Voices library");
    Path path = Paths.get("InfoQ_English");
    audio.save(path);
}

The previous example used a model retrieved at build time via the Maven dependency. Alternatively, other models can be retrieved during runtime via the following Maven dependency:


<dependency>
    <groupId>org.pitest.voices</groupId>
    <artifactId>model-downloader</artifactId>
    <version>0.0.8</version>
</dependency>

Now the models can be used via factory methods on the following classes:


org.pitest.voices.download.Models
org.pitest.voices.download.UsModels
org.pitest.voices.download.NonEnglishModels

The following example uses the Dutch nlNLRonnie model from the NonEnglishModels class to convert Dutch text to a Dutch sound file:


Model nlModel = NonEnglishModels.nlNLRonnie();

ChorusConfig config = chorusConfig(EnUkDictionary.en_uk());

try (Chorus chorus = new Chorus(config)) {

    Voice alba = chorus.voice(nlModel);

    Audio audio = alba.say("Dit is een Nederlandse tekst Scheveningen");
    Path path = Paths.get("Dutch");
    audio.save(path);
}

Alternatively, OpenVoice may be used to improve the resulting speech without requiring a dictionary. However, it requires more computational power and has a significantly larger model of 50 MB compared to the 3 MB dictionary file. The following dependency enables support for OpenVoice with Maven:


<dependency>
    <groupId>org.pitest.voices</groupId>
    <artifactId>openvoice-phonemizer</artifactId>
    <version>0.0.8</version>
</dependency>

After declaring the dependency, the OpenVoiceSupplier model can be used:


ChorusConfig config = chorusConfig(Dictionaries.empty()).withModel(new OpenVoiceSupplier());
try (Chorus chorus = new Chorus(config)) {

    Voice alba = chorus.voice(Alba.albaMedium());

    Audio audio = alba.say("This is the InfoQ article about the Voices library");
    Path path = Paths.get("InfoQ_English_OpenVoice");
    audio.save(path);
}

OpenVoice also supports other voices in UK or US English and languages such as Dutch, as shown in the following example:


Model nlModel = NonEnglishModels.nlNLRonnie();
ChorusConfig config = chorusConfig(Dictionaries.empty())
        .withModel(new OpenVoiceSupplier());

try (Chorus chorus = new Chorus(config)) {

    Voice alba = chorus.voice(nlModel);

    Audio audio = alba.say("Dit is een Nederlandse tekst Scheveningen");
    Path path = Paths.get("Dutch_OpenVoice");
    audio.save(path);
}

The library also allows running the models on the GPU instead of the CPU by removing the onnxruntime from the classpath and adding the onnxruntime_gpu dependency, for example, via the Maven pom.xml. Next, the gpuChorusConfig should be used instead of the ‘normal’ chorusConfig:


ChorusConfig config = gpuChorusConfig(EnUkDictionary.en_uk());

By default, GPU 0 is used without further options; alternatively, the withCudaOptions() method, defined in the ChorusConfig class, may be used for configurations.

Pauses are added when the library encounters Markdown symbols: #; —; or em or en dashes; in the text.

As with other configurations, the ChorusConfig class may be used to change the defaults for pauses.

Various alternative text-to-speech solutions, such as Sherpa Onnx and MaryTTS, are harder to consume from build tools like Maven and/or produce lower quality voices.

InfoQ reached out to Henry Coles to learn more about Voices.

InfoQ: What types of use cases do you envision as the most common for voices? Can you share some examples where this library really shines?

Henry: The code was originally part of a tool for editing fiction. I can only guess where else it might be useful, but it shines when you need to generate reasonably natural-sounding speech quickly and don’t want to rely on external services.

InfoQ: What inspired you to create the Voices library?

Henry: I needed to generate speech from Java, and most modern Text to Speech (TTS) libraries are written in Python. Initially, I ran piper as an HTTP service, but this was inconvenient, so I began to search for ways to run the piper models from Java.

InfoQ: What made you decide to create a new library instead of collaborating on an existing solution?

Henry: The existing Java TTS solutions were established a long time ago and sound robotic by modern standards. They’d be difficult to improve. By contrast, running the piper ONNX models is trivial except for one missing piece: Java code to convert text to phonemes. I couldn’t find a Java phonemiser anywhere, so I had to hack one together.

InfoQ: What challenges did you face while building voices, and how did you overcome them? Were there any key design decisions that you debated on?

Henry: The main challenge was knowing nothing about linguistics. The development process was also completely different from how I usually work. It was largely a porting project, translating TypeScript logic to Java. Testing what was essentially someone else’s logic was further complicated by the fact that there are no clear “correct” answers. English can’t really be phonomised by simple rules (special case handling is required via a dictionary), so for some inputs the output is always going to be wrong; it’s a question of deciding which ones. I ended up with a very manual development loop, generating audio and scoring it by ear, then adding test cases to catch regression for that particular input.

InfoQ: Which part of the library would you like to improve?

Henry: I’d like to clean up the API. The current one was created to meet a single use case quickly; something nicer could likely be created with a bit of upfront thought.

InfoQ: Are there any plans to add functionalities in the future?

Henry: If I get a chance, I’ll take a look at improving how it handles pauses and setting the rhythm of the speech.

InfoQ: What automated testing approach do you recommend for applications using the library? Maybe using a speech-to-text solution to be able to compare the input and the output?

Henry: I’d recommend testing the output sparingly. A couple of tests that check that audio is produced and everything is wired up correctly make sense, but the library’s functionality is not something client apps control, so they should mainly concern themselves with checking on the input to the boundary.

More information and examples can be found on GitHub.

Sign Up For Daily Newsletter

Be keep up! Get the latest breaking news delivered straight to your inbox.
By signing up, you agree to our Terms of Use and acknowledge the data practices in our Privacy Policy. You may unsubscribe at any time.
Share This Article
Facebook Twitter Email Print
Share
What do you think?
Love0
Sad0
Happy0
Sleepy0
Angry0
Dead0
Wink0
Previous Article Porsche opens strategic China R&D center with independent decision-making to accelerate development · TechNode Porsche opens strategic China R&D center with independent decision-making to accelerate development · TechNode
Next Article China’s Baidu to deploy “thousands” of robotaxis in Europe in partnership with Lyft · TechNode China’s Baidu to deploy “thousands” of robotaxis in Europe in partnership with Lyft · TechNode
Leave a comment

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Stay Connected

248.1k Like
69.1k Follow
134k Pin
54.3k Follow

Latest News

Scaling API Independence: Mocking, Contract Testing & Observability in Large Microservices Environments
Scaling API Independence: Mocking, Contract Testing & Observability in Large Microservices Environments
News
Kenya’s new gambling law wants to force gamblers to save
Kenya’s new gambling law wants to force gamblers to save
Computing
Get a Samsung Galaxy S25 FE for less than £500 before Black Friday hits
Get a Samsung Galaxy S25 FE for less than £500 before Black Friday hits
Gadget
You&apos;re About to Ruin Thanksgiving Dinner With the Wrong Cooking Oil
You're About to Ruin Thanksgiving Dinner With the Wrong Cooking Oil
News

You Might also Like

Scaling API Independence: Mocking, Contract Testing & Observability in Large Microservices Environments
News

Scaling API Independence: Mocking, Contract Testing & Observability in Large Microservices Environments

52 Min Read
You&apos;re About to Ruin Thanksgiving Dinner With the Wrong Cooking Oil
News

You're About to Ruin Thanksgiving Dinner With the Wrong Cooking Oil

13 Min Read
M5 MacBook Pro benchmarks impressive, but little real-world benefit
News

M5 MacBook Pro benchmarks impressive, but little real-world benefit

6 Min Read
Why the UK must focus investment in its four innovation powerhouses – UKTN
News

Why the UK must focus investment in its four innovation powerhouses – UKTN

1 Min Read
//

World of Software is your one-stop website for the latest tech news and updates, follow us now to get the news that matters to you.

Quick Link

  • Privacy Policy
  • Terms of use
  • Advertise
  • Contact

Topics

  • Computing
  • Software
  • Press Release
  • Trending

Sign Up for Our Newsletter

Subscribe to our newsletter to get our newest articles instantly!

World of SoftwareWorld of Software
Follow US
Copyright © All Rights Reserved. World of Software.
Welcome Back!

Sign in to your account

Lost your password?