Package: festival
Version: 1.4.3-17.2
Severity: normal
Tags: patch
Hi,
the current way of extending festival's list of known languages in
languages.scm is broken. The functions male1, male2, female1 etc.
that get defined in the language_* functions only work once due to
autoloading tricks.
An example with the britishenglish language:
# apt-get install festival festvox-rablpc16k festvox-don
[...]
% festival --language britishenglish
Festival Speech Synthesis System 1.4.3:release Jan 2003
Copyright (C) University of Edinburgh, 1996-2003. All rights reserved.
For details type `(festival_warranty)'
festival> (male2); male1 was automatically activated first
don_diphone
festival> (male1)
SIOD ERROR: autoload:
"/usr/share/festival/voices/english/rab_diphone/festvox/rab_diphone.scm" does
not define voice_rab_diphone
festival> (male2)
SIOD ERROR: autoload:
"/usr/share/festival/voices/english/don_diphone/festvox/don_diphone.scm" does
not define voice_don_diphone
The situation is the same at least with the Italian and the Finnish
voices (although the Finnish female1 definition needs s/suo_lj/suo_fi_lj,
which I will file a separate bug about.)
This happens because the voice_* functions are autoloaded by a temporary
function that verifies that the autoload was succesful by comparing the
original voice_* function to the one after the autoload. Unfortunately,
the male1, male2 etc. functions each refer to the temporary function
rather than the real one. The function doesn't change anymore after the
second call, resulting in an error.
Consider:
% festival --language britishenglish
Festival Speech Synthesis System 1.4.3:release Jan 2003
Copyright (C) University of Edinburgh, 1996-2003. All rights reserved.
For details type `(festival_warranty)'
festival> male2 ; look at the autoload function definition
#<CLOSURE n (let ((me voice_don_diphone)) (require
"/usr/share/festival/voices/english/don_diphone/festvox/don_diphone") (if (eq
me voice_don_diphone) (error (string-append "autoload: \""
"/usr/share/festival/voices/english/don_diphone/festvox/don_diphone" ".scm\"
does not define " (quote voice_don_diphone)))) (apply voice_don_diphone n))>
festival> voice_don_diphone ; an alias of the above
#<CLOSURE n (let ((me voice_don_diphone)) (require
"/usr/share/festival/voices/english/don_diphone/festvox/don_diphone") (if (eq
me voice_don_diphone) (error (string-append "autoload: \""
"/usr/share/festival/voices/english/don_diphone/festvox/don_diphone" ".scm\"
does not define " (quote voice_don_diphone)))) (apply voice_don_diphone n))>
festival> (male2) ; actually activate the voice
don_diphone
festival> male2 ; still the original autoload function definition
#<CLOSURE n (let-internal (me) (voice_don_diphone) (begin (require
"/usr/share/festival/voices/english/don_diphone/festvox/don_diphone") (if (eq
me voice_don_diphone) (error (string-append "autoload: \""
"/usr/share/festival/voices/english/don_diphone/festvox/don_diphone" ".scm\"
does not define " (quote voice_don_diphone)))) (apply voice_don_diphone n)))>
festival> voice_don_diphone ; the actual voice is now loaded
#<CLOSURE nil (begin "(voice_don_diphone)
Set up the current speaker to be British male RP speaker, LPC Donovan
diphones."
[...]
festival> (male2) ; second activation fails
SIOD ERROR: autoload:
"/usr/share/festival/voices/english/don_diphone/festvox/don_diphone.scm" does
not define voice_don_diphone
The proposed fix is to define the male1, male2 etc. helper functions so
that the function they call is evaluated at runtime. This works for me:
--- languages.scm 2006-09-03 18:23:12.000000000 +0300
+++ languages.scm-fixed 2007-06-04 22:46:15.000000000 +0300
@@ -45,8 +45,8 @@
(require 'voices)
;; Will get more elaborate, with different choices of voices in language
- (set! male1 voice_rab_diphone)
- (set! male2 voice_don_diphone)
+ (set! male1 (lambda () (voice_rab_diphone)))
+ (set! male2 (lambda () (voice_don_diphone)))
(if (symbol-bound? 'voice_gsw_diphone)
(set! male3 voice_gsw_diphone))
(if (symbol-bound? 'voice_gsw_450)
Obviously, a similar fix should be applied to the helper functions
of all the languages in languages.scm .
Cheers,
--
Niko Tyni [EMAIL PROTECTED]
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]