Haiku Natural Voice Offline TTS (piper tts)

​[Release] HaikuTTS: A High-Quality, Natural Voice TTS Engine for Haiku

​Hello Haiku community!

​I’m excited to announce the first release of HaikuTTS, a powerful, offline text-to-speech engine that brings natural, human-like voices to our favorite operating system.

​This project was born out of a desire for a modern, high-quality TTS solution on Haiku. It’s built upon the excellent Piper TTS engine, which is renowned for its natural-sounding voices across many languages. The real breakthrough was porting Piper’s lightweight NCNN version to Haiku.

​The entire development process was done on Haiku 64-bit, which included compiling the NCNN static library from source and then rewriting the application logic to integrate with Haiku’s native sound system.

Key Features & Licensing

  • High-Quality Offline Voices: No internet connection required.
  • Native Haiku Audio: Uses the system’s BSoundPlayer for direct audio playback.
  • BSD License: To avoid the GPL license of espeak-ng’s library, HaikuTTS makes a command-line call to the espeak tool for phonemization, keeping the application under a permissive BSD license.
  • Semi-Native Build: The core program is a semi-native Haiku application.

How to Use

  1. Install espeak: You must have espeak installed from HaikuDepot. The older version available works well enough for this purpose.

  2. Download a Voice Model: I have published 29 NCNN voice models on Hugging Face. Download the model you want to use.

  3. Download HaikuTTS: Get the program executable from the link below.

  4. Run from Terminal: Use the command line to generate speech from text, a file, or standard input.

​A special note: It would be fantastic if someone in the community could tackle the challenge of compiling the latest espeak-ng for Haiku, as it would surely improve the quality even further!

Future Plans & Downloads

​If this program is well-received, I plan to publish the API and the source code for the core library to allow other developers to integrate it into their applications.
haikutts binary (haiku is 64 bit x86) folder:

​I look forward to your feedback!

@gyroing (github and huggingface)

program help:
Usage: haikutts <model_dir> <speaker_id> [OPTIONS] [espeak_lang_override]

A command-line Text-to-Speech (TTS) program for the Haiku using Piper NCNN models.
The program automatically detects the model configuration from the specified directory.
Input text is read with the following priority: -t > -f > stdin.

Arguments:

<model_dir> Path to the directory containing all files for a single model
(e.g., *.ncnn.param, *_config.txt).

<speaker_id> The integer ID of the speaker/voice to use. For single-speaker
models, this is typically 0.

[espeak_lang_override] (Optional) Override the espeak voice used for phoneme generation
(e.g., “fr-fr”). If not provided, the “espeak_voice” value
from the config file is used.

Options:

-t, --text “…” The text string to synthesize. Highest priority input.

-f, --file Read input text from a UTF-8 file.

-o, --output Path to save the output as a WAV file. If omitted, the
synthesized audio will be played directly.

-h, --help Show this help message and exit.

example:
echo " hi kaiku" | ./haikutts ./models/en_GB-alba 0

20 Likes

Just a reminder: The usual cautions downloading and installing binaries from somewhere off the interwebs apply.

1 Like

I understand your concern. Unfortunately, I haven’t found any other way for others to test the tts app.

Anyone interested can test it, and after receiving feedback, I’ll soon put its recipe in HaikuPorts.

1 Like

Just what I was looking for! In a couple of days I will try it out.

2 Likes

To simplify command line, models should go in data directory.
For example, if you put the app in a folder named HaikuTTS located in /boot/home/config/non-pakaged/apps , model folders should go in /boot/home/config/non-packaged/data/HaikuTTS/models and if you put the app folder in /boot/system/non-packaged/apps models would go in /boot/system/non-packaged/data/HaikuTTS/models
Then data path can be made relative at app level and is always ../../data/HaikuTTS/models

Note: If you want to try it, don’t forget to give execution rights to the app.

3 Likes

Thanks.

Did you even check the program?
Did it work on your system?

My goal was to get your feedback before submitting it to HaikuPorts.

I quickly tried alba and siwis models on an up to date nightly 64 bits. It seems to work fine.

2 Likes

Version 1.0 of the haikutts recipe is ready and has been tested. The corresponding Pull Request has been submitted to the main HaikuPorts repository and its status can be tracked at:

1 Like

applied in recepi pull request

Usage: haikutts -m <model_name> [OPTIONS]

A command-line Text-to-Speech (TTS) program for the Haiku using Piper NCNN models.
The program automatically detects the model configuration from the specified directory.
Input text is read with the following priority: -t > -f > stdin.

Mandatory Argument:

-m, --model <model_name> The name of the model directory to use.

Options:

-p, --path Path to the base directory containing model folders.
(Default: /boot/home/config/non-packaged/data/HaikuTTS/models/)

-s, --speaker_id The integer ID of the speaker/voice to use.
(Default: 0).

-l, --lang <lang_code> Override the espeak voice used for phoneme generation
(e.g., “fr-fr”). If not provided, the “espeak_voice” value
from the config file is used.

-t, --text “…” The text string to synthesize. Highest priority input.

-f, --file Read input text from a UTF-8 file.

-o, --output Path to save the output as a WAV file. If omitted, the
synthesized audio will be played directly.

-h, --help Show this help message and exit.

models:

2 Likes

Please check our trademark
policy.

3 Likes

Still haven’t been able to build espeak-ng, been crossing my path for years :smiley:

I tried to compile the espeak-ng binary itself, which builds easily, but I couldn’t find any solution for building espeak-ng-data.

My guess is that it might be due to the absence of a proper C locale.
Even by importing a precompiled espeak-ng-data from other OSes, the result was unsuccessful.

If a C locale compatible with POSIX is not available in Haiku, this won’t be possible.

2 Likes

I am currently adding Italian - Armenian - Swedish languages ​​- the models are being prepared, some may not work like Arabic or Ukrainian. The problem is not with the software - the problem is that there is no espeak-ng as an alternative.
With Piper TTS
Haiku should have had a better TTS for its environment.

2 Likes

PiperTTS-NCNN Models (ready to use):

ar_SA – kareem – Arabic (Saudi Arabia)

cs_CZ – jirka – Czech (Czechia)

da_DK – talesyntese – Danish (Denmark)

de_DE – dili – German (Germany)

de_DE – torsten – German (Germany)

el_GR – rapunzelina – Greek (Greece)

en_GB – alba – English (UK)

en_US – girl – English (US)

en_US – john – English (US)

es_ES – sharvard – Spanish (Spain)

es_MX – ald – Spanish (Mexico)

fa_IR – ganji – Persian (Iran)

fa_IR – gyro – Persian (Iran)

fr_FR – siwis – French (France)

hi_IN – rohan – Hindi (India)

hu_HU – anna – Hungarian (Hungary)

hy_AM – gor – Armenian (Armenia)

id_ID – tts – Indonesian (Indonesia)

it_IT – dili – Italian (Italy)

it_IT – miro – Italian (Italy)

ka_GE – natia – Georgian (Georgia)

ne_NP – chitwanic – Nepali (Nepal)

nl_BE – nathalie – Dutch (Belgium)

nl_NL – pim – Dutch (Netherlands)

no_NO – talesyntese – Norwegian (Norway)

pl_PL – gosia – Polish (Poland)

pt_BR – cadu – Portuguese (Brazil)

pt_PT – tugao – Portuguese (Portugal)

ro_RO – mihai – Romanian (Romania)

ru_RU – dmitri – Russian (Russia)

sk_SK – lili – Slovak (Slovakia)

sr_RS – serbski_institut – Serbian (Serbia)

sv_SV – nst – Swedish (Sweden)

sw_KE – lanfrica – Swahili (Kenya)

tr_TR – fahrettin – Turkish (Turkey)

uk_UK – ukrainian_tts – Ukrainian (Ukraine)

vi_VN – vais – Vietnamese (Vietnam)

zh_CH – huayan – Chinese (China)

1 Like

Can voice models be packaged (one per lang)?

1 Like

In the next version, I plan to implement in-app downloading of the models.
By selecting a model name, the model will be downloaded and placed in the path:
/boot/home/config/non-packaged/data/pipertts/models/

Currently, the usable models are available at:

After downloading, they can be extracted to any location and loaded using the --path or -p option and call the model name by -m {model_name} (see the app --help)
If they are in the default path, no path argument is needed; only selecting the model name is required in this case.
I believe that in-app downloading would have less overhead and make model management easier for future use.

2 Likes

wow… in indonesian too… love to try it

It don’t like this way. Packages store files compressed (about 7% less for your models). Version control and system state store available out of the box (you don’t need invent a bicycle). Also packages can be installed depend on locale or 3rd party app.

1 Like

Voice models may be updated regularly.
The in-app downloading method is exactly the same approach used in the Piper (ONNX) app. At the same time, packaging each model individually is easily feasible, so I plan to do that.

Most of the models on Hugging Face can be packaged, except for those whose languages are not supported in espeak 1.48, such as Arabic and Ukrainian.