Does it use eSpeak?
- User
Does it use eSpeak?
Assistant
Yes, [Redacted Person] uses eSpeak-NG (a fork of eSpeak) for phonemization - converting text into phonemes (sound units) before speech synthesis. This is evident from several parts of the codebase:
- eSpeak is used by default for phonemization unless explicitly configured otherwise. From the code, there are two phoneme types:
- "espeak" phonemes (default) which use eSpeak-NG
- "text" phonemes which use a predefined alphabet
- The codebase requires eSpeak-NG as a dependency:
- The README mentions "Ensure you have espeak-ng installed (sudo apt-get install espeak-ng)"
- The C++ code includes espeak-ng headers and initializes it for text-to-phoneme conversion
- In the configuration, you can specify eSpeak voice settings like:
json{ "espeak": { "voice": "<language code>" } }The eSpeak voice determines the language/accent used for phonemization (e.g. "en-us" for US English).
However, eSpeak is only used for the phonemization step (text -> phonemes). The actual speech synthesis (phonemes -> audio) is handled by VITS neural models exported to ONNX format. So eSpeak provides the linguistic frontend while the neural models handle the audio generation.
- User
Does README instruct to install espeak-ng?
Assistant
Yes, in the TRAINING.md file (not README.md), it instructs to install espeak-ng:
codeEnsure you have espeak-ng installed (sudo apt-get install espeak-ng)I apologize for incorrectly stating this was in the README. Let me correct my earlier response - while Piper does use eSpeak-NG, the installation instruction appears in the training documentation rather than the main README file.
- User
is espeak-ng required for training as well as inference?
Assistant
Looking at the codebase:
For inference (using a trained model):
- eSpeak-NG is used for phonemization by default unless configured otherwise
- The C++ code shows eSpeak initialization is conditional:
cppif (config.useESpeak) { spdlog::debug("Initializing eSpeak"); int result = espeak_Initialize(AUDIO_OUTPUT_SYNCHRONOUS, /*buflength*/ 0, /*path*/ config.eSpeakDataPath.c_str(), /*options*/ 0); if (result < 0) { throw std::runtime_error("Failed to initialize eSpeak-ng"); } }For training:
- The training documentation specifically requires installing espeak-ng before training
- This is because during dataset preprocessing, eSpeak-NG is used to convert the training text into phonemes that the model will learn from
So yes, eSpeak-NG appears to be required for both training and inference, unless you're using a voice model specifically configured to use text phonemes instead of eSpeak phonemes (via the "phoneme_type" config setting).
- User
Does the following require eSpeak then: ```bash echo "Hi there!" | ../Piper/piper/piper
-m ../Piper/models/amy/en_US-amy-medium.onnx
-c ../Piper/models/amy/en_en_US_amy_medium_en_US-amy-medium.onnx.json
--output-raw | aplay -r 22050 -f S16_LE -t raw -code Assistant
Yes, this command would require eSpeak-NG because:
-
Looking at the code, [Redacted Person] uses eSpeak-NG by default for phonemization unless explicitly configured otherwise in the model's config file
-
The model being used (en_US-amy-medium) is an English voice model, and English voice models in Piper are configured to use eSpeak phonemes by default. This can be seen in the code where English voices use:
json{ "phoneme_type": "espeak", "espeak": { "voice": "en-us" } }- The command doesn't include any flags to disable eSpeak usage or override the phonemization method
So when you run this command, [Redacted Person] will:
- Use eSpeak-NG to convert "Hi there!" into phonemes
- Feed those phonemes into the neural model (en_US-amy-medium.onnx)
- Generate raw audio output that gets piped to aplay
If eSpeak-NG is not installed or properly configured, this command would fail during the phonemization step.
-
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.