Option "language <name>"already causes SelectTranslator(<name>) to be
called. Having two options to do almost the same thing is unnecessary
and confusing.
In the long term, all options from SelectTranslator() should have a
switch case in LoadVoice() so they are user configurable (see #218). If
needed, a new option (maybe called "LoadOptions") could be added to load
an existing voice or language file.
Changes language configuration files for: hak, cmn, yue, ltg, ms, mb-ma1.
No changes to users.
voices: Change default number pronunciation rule to enabled.
docs: add details about number flags to the documentation.
It's clearly intended to be enabled by default:
- it's defined as default behaviour translate.h (NUM_DEFAULT)
- tr_languages.c sets many default values related to number processing
that have no meaning unless langopts.numbers == 1.
It is also a more sensible default since most languages will want to
have number processing on. This makes adding new languages easier
because adding an entry to tr_languages.c is unnecessary.
A negative side effect is that languages with partial number defines
might experience bugs when reading undefined numbers. This is a bug and
should be fixed.
This will have the side effect of enabling number processing for
languages that currently have it disabled. However, there shouldn't be
any.
Here's a way to check affected languages:
for voice in $(ESPEAK_DATA_PATH=`pwd` LD_LIBRARY_PATH=src:${LD_LIBRARY_PATH}
src/espeak-ng --voices | grep -v Languages | awk '{print $2}'); do
OUTPUT=$(ESPEAK_DATA_PATH=`pwd` LD_LIBRARY_PATH=src:${LD_LIBRARY_PATH}
src/espeak-ng -qx -v $voice "1 - 2 - 3 - 12 - 123") && echo "$voice:
$OUTPUT" ; done
These voices clearly benefit from enabling numbers (they already have
number rules in *_list):
ba, cmn (zh), hak, haw, ja, kok, nb, nci
Some languages are missing some definitions (like _12) in _list files.
It causes the program to skip some numbers.
Numbering needs to be turned off explicitly for:
jbo, mi, my, piqd, py, qu, quc, th, uz
Languages with no number rules at all:
chr, cv, he, nog, tk, ug
Espeak-ng uses bitrate 16 internally. If the input inside <audio> has a
different bitrate the audio will not play correctly unless converted to
16 bits.
Closes #885.
It is supposed to be used with SSML for reading < (<) and & (&)
when invoking espeak-ng --punct -m.
However, it looks like the code is dead since removing it doesn't fail
the ssml reference test.
code cleanup: remove unnecessary current_voice_id in readclause.c
Instead of passing a temporary variable current_voice_id to SSML
processing logic and then copying the value to voice_change, pass
voice_change directly. GetVoiceAttributes() both sets voice_change and
retuns CLAUSE_TYPE_VOICE_CHANGE that is used by TranslateClause() for
error checking.
tests/ssml/language-switch.ssml covers the intended behavior of language
switching and will fail when either voice_change or CLAUSE_TYPE_VOICE_CHANGE
is not set correctly.
code cleanup: reorganize check for u.s.a.'s in int ReadClause()
This approach reduces the amount of nested if statements and doesn't
require the temporary variable int c_next_2.
A test already exists for this case in tests/translate.test
Code cleanup: remove param2 from langopts and rename keyword option in language files.
- param2[] is only used to set a second value to LOPT_BRACKET_PAUSE. It is simpler
to have two values in param[] instead. This simplifies the codebase.
- Instead of setting "option bracket X Y" in language files, use
keywords "brackets X" and "bracketsAnnounced Y" instead to follow the
naming convention of other keywords.
- Add missing documentation to docs/voices.md.
code cleanup: move check for SSML comments and declarations to
ProcessSsmlTag()
Note the line in readclause.c:
if ((c2 == '/') || iswalpha(c2) || c2 == '!' || c2 == '?') {
It might be enough to pass everything to ProcessSsmlTag. What are the
cases that are skipped because of this?
code cleanup: Move self_closing checks to ProcessSsmlTag()
This is a bit slower since we don't pass n_xml_buf as an argument but
rather get it with a call to wcslen. It is much cleaner though, since
the name ProcessSsmlTag() implies that all processing should be done
there.
code cleanup: Check all local includes with include-what-you-use
Going through files in src/libespeak-ng/, include-what-you-use removed a
few unnecessary includes and included explanations on why a certain
header should be included. This makes tracking globals and dependencies easier.
Running the codebase through IWYU should be repeated after each major
code restIncludes to standard c library weren't checked to avoid
breaking builds with other platforms.
See https://github.com/include-what-you-use/include-what-you-use
code cleanup: remove unused int vowel_transition[4]
There's two variables with the same name:
1) in struct PHONEME_DATA, used by *phdata, *phdata_next and *phdata_prev
2) an unnecessary one that's only being memset() twice but never used
for anything
code cleanup: change global int current_phoneme table to static
It's only used in SpeakNextClause() and related to SelectPhonemeTable().
Another solution void be to keep SelectPhonemeTable() as a void function
and do a current_phoneme_table = voice->phoneme_tab_ix after the call to
SelectPhonemeTable().
code cleanup: pass voice_t wvoice as a parameter instead of using a global
SetSynth_Klatt() was using wvoice in two ways:
1) global wvoice was used directly
2) global wvoice was also passed in Wavegen_Klatt() as an argument "v"
Now the code only uses the function argument wvoice
Contributes to #68.