daisy / daisy/pipeline-modules
Getting the List of Voices for eSpeak Fails with Espeak-NG
- Dominant language
- HTML
- Stars
- 4
- Forks
- 6
- PR merge metrics
- No merged PRs in 30d
Description
### Expected Behavior
I tried to run the EPUB Enhancer script (epub3-to-epub3) on an EPUB with TTS enabled on Linux using the command-line interface.
### Actual Behavior
The Espeak engine failed to activate because getting the list of voices failed, so all sentences failed to be spoken and the resulting EPUB had no audio.
### Steps to Reproduce
1. Make sure eSpeak-NG is installed and can be found on the system path as espeak (create a symbolic link if necessary)
2. Make sure eSpeak has a higher priority than any other TTS
3. From the cli directory of the Pipeline, run "./dp2 epub3-to-epub3 --source {epub} --tts true -o {output directory} --include-tts-log true [--tts-config {TTs configuration file}]"
### Details
The problem seems to be in the regular expression that extracts details about voices from the output of the espeak command for a specific language, specifically when it extracts the gender. The error is traced to line 133 of modules/tts/tts-adapters/tts-adapter-espeak/src/main/java/org/daisy/pipeline/tts/espeak/impl/ESpeakEngine.java. The part that causes the error is "mr.group("gender").trim().toLowerCase()". Above this line the locale is matched successfully, so I think there must be a slight difference between how the old eSpeak prints the gender in the voice table and how eSpeak-NG does. The regular expression string that mr is created using is "^\\\\s\*[0-9]+\\\\s+(?[-a-z]+)\\\\s+(?[FfMm-]\\\\s+)?(?[^ ]+)". I tried changing the regular expression to make it match the output of Espeak-NG, but I could not fix the issue. The last one I tried is "^\\\\s\*[0-9]+\\\\s+(?[-a-zA-Z0-9]+)\\\\s+-\*\\\\/\*(?[FfMm]\\\\s+)(?[^ ]+)".
### Environment
* Operating system: Arch Linux X86_64
* DAISY Pipeline 2 version: master (compiled from source)
* Interface: Command Line
* ESpeak-NG Version: 1.51.1
### Logs
[Logs](https://gist.github.com/emassey0135/7500942830ef6e0cfa5059d7351afdb7)
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.