FS#7646 - Perl voicebuilding

Attached to Project: Rockbox
Opened by Jonas Häggqvist (rasher) - Wednesday, 22 August 2007, 21:59 GMT
Last edited by Jonas Häggqvist (rasher) - Saturday, 25 August 2007, 22:15 GMT
Task Type Patches
Category Build environment
Status Closed
Assigned To No-one
Operating System All players
Severity Low
Priority Normal
Reported Version Daily build (which?)
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No


This is the first attempt to port the current voice scripts to perl. The benefits are/should be numerous:
- Should give a huge speedup on Cygwin
- Also gives a nice speedup in Linux & relatives.
- Should allow better use of SAPI (it might be possible to keep a single connection open)
- Perl, as horrible as it is, is probably more hacker-friendly than shell for large jobs, and should hopefully allow more people to help out.
- The configure script looks slightly nicer. And voice building is better integrated.
- is a single file and can be run directly from the commandline. In theory all that's needed is voicefont, genlang, english.lang and the appropriate language-file.

There are still some caveats though:
- The reason for this re-implementation was to allow TTS tweaks (phonetical replacements) - I have not added this yet.
- The script should eventually allow .talk clip generation as well. This is not yet implemented.

Given how much brouhaha the last voice change generated, I wonder if this should get a mention on either of the mailing lists? Thoughts?
This task depends upon

Closed by  Jonas Häggqvist (rasher)
Saturday, 25 August 2007, 22:15 GMT
Reason for closing:  Accepted
Additional comments about closing:  Commmitted in r14457
Comment by Jonas Häggqvist (rasher) - Wednesday, 22 August 2007, 22:03 GMT
I also forgot, probably most importantly:
- SAPI5 building isn't implemented yet. This should definitely be done before even considering committing this. If someone with a clue about Windows/SAPI5 could do this, I'd very much appreciate it.
Comment by Jonas Häggqvist (rasher) - Friday, 24 August 2007, 12:50 GMT
Updated patch that adds the following:
- Responds to V=1 being set (call "V=1 make voice" to see details during build)
- Shows a bit of information about what's being built
- Shows progress indicator
- An attempt at SAPI5 building (still just calls the .vbs over and over - someone could probably improve this)

Please test and report back - especially SAPI5 voice building.
Comment by Jonas Häggqvist (rasher) - Friday, 24 August 2007, 12:51 GMT
And I of course forgot the file.
Comment by Jonas Häggqvist (rasher) - Friday, 24 August 2007, 14:51 GMT
- Add sapi5_voice_new.vbs - accepts alternating lines of string and filename on stdin and voices the string into filenames. Exits when filename is blank.
- Use this script for SAPI5 building - this greatly speeds up voicefile generation in Cygwin (launching LAME many times still takes time, but there's probably not much that can be done about that).
Comment by Bryan Childs (GodEater) - Friday, 24 August 2007, 15:49 GMT
Works fine on linux here (Gentoo if it matters). Got about a 20 second speed increase too.
Comment by Jonas Häggqvist (rasher) - Friday, 24 August 2007, 23:44 GMT
- Add possibility to do regexp search&replace on strings
- Special handling of VOICE_PAUSE (this file is added to the tools/ dir
- Add wavtrim step
- Fix tools/Makefile to remove voicefont and wavtrim when running make clean (not related, to be honest)
- Save the voicefile to a different filename instead of overwriting an existing voicefile of the same name

I created a section on the VoiceBuilding wikipage for keeping track of this patch.
Comment by Jonas Häggqvist (rasher) - Saturday, 25 August 2007, 12:20 GMT
Two tiny (but somewhat important changes)
- Fix the call to voicefont to properly include the target id
- Change the default lame settings to include -B 64 and --vbr-new
Comment by Jonas Häggqvist (rasher) - Saturday, 25 August 2007, 21:51 GMT
This should be my final version. Changes in this version:
- Building of multiple voices disabled (it wasn't implemented properly, so I'll have a go at it after this has been committed)
- The voice script now cleans up after itself if interrupted
- Changing of default options for festival based on which language is selected, the same could easily be done for other engines.