Commit Graph
1815 Commits
Author SHA1 Message Date
Juho Hiltunen 1a5db2f498 code cleanup: move dict_min_size handline in LoadVoice(). 2021-07-11 19:43:04 +03:00
Juho Hiltunen 0e7202f9a9 code cleanup: remove unused language option l_length_mods.
It is not used by any language. There is no need to check for it in
LoadVoice().
2021-07-11 19:09:44 +03:00
Juho Hiltunen 863655903a code cleanup: move SetLengthMods to setlengths.c 2021-07-11 17:05:00 +03:00
Juho Hiltunen 72434616b0 code cleanup: move voice->freq2 and voice->height2 handline in LoadVoice().
VoiceReset() now sets them initially. VoiceFormant() changes them if
"formant" option is used.
2021-07-11 16:30:17 +03:00
Juho Hiltunen f269acf22c code cleanup: remove unneeded switch case for stress_rule = 10.
There are nolanguages that use stress_rule = 10.
2021-06-29 15:55:05 +03:00
Juho Hiltunen c6ef7061ca code cleanup: use #defines for stress positions.
The #defines should be renamed to better convey their meaning.
2021-06-29 15:54:45 +03:00
Juho Hiltunen b74ad1777d eu: remove duplicate stress_rule from tr_languages.c
It's already set in espeak-ng-data/lang/eu
2021-06-29 15:14:46 +03:00
agonzalezd 2fb981855b eu: Updated Basque phonetics and stress rule 2021-06-29 15:14:26 +03:00
Łukasz Golonka 289d9d865e Revert "code cleanup: change global int current_phoneme table to static"
This works around issue 915
2021-06-07 17:49:20 +03:00
Juho Hiltunen 4d0a4df86b Revert "code cleanup: remove unnecessary current_voice_id in readclause.c"
See #950.
2021-06-07 17:43:28 +03:00
Reece H. Dunn a13f9bb62a Fix -Wint-conversion warnings. 2021-05-30 17:55:41 +01:00
Reece H. Dunn f581436deb Fix -Wmissing-prototypes warnings. 2021-05-30 17:30:55 +01:00
Reece H. Dunn 720405c5c6 Fix -Wreturn-type warnings. 2021-05-30 17:22:48 +01:00
Reece H. Dunn 53283a910a Fix -Wunused-but-set-variable warnings. 2021-05-30 17:19:54 +01:00
Reece H. Dunn ed6e096b5b Fix -Wunused-function warnings. 2021-05-30 17:15:52 +01:00
Reece H. Dunn 5791bf28de Fix -Wunused-parameter warnings. 2021-05-30 17:10:25 +01:00
Juho Hiltunen 389ce6b738 code cleanup: remove unused FLAG_HYPHENATED and related code.
The flag is never set anywhere so the if-clause will always evaluate to false.
2021-05-28 20:52:49 +03:00
Juho Hiltunen ac5eeb865e code cleanup: new function CheckTranslator()
When a language or voice file in espeak-ng-data is loaded the keyword
"translator" must be set so that other language options can modify the
values in struct Translator.

CheckTranslator() provides standardized error for all switch cases that
modify a value in struct Translator.
2021-05-22 13:38:03 +03:00
Juho Hiltunen fb233a7b0c code cleanup: move stressLength, stressAdd and stressAmp handling in LoadVoice()
From now on, stressLength must be set before stressAdd because
stressLength will overwrite any previous value. Usually stressLength is
set in a language file and stressAdd in a voice file.

Previously the order of the two commands didn't matter.
2021-05-22 13:38:03 +03:00
Juho Hiltunen 7c32085dcd code cleanup: use translator instead of langopts in LoadVoice()
Since new_translator isn't used anymore langopts will always point to
translator anyway.
2021-05-22 13:38:03 +03:00
Juho Hiltunen f16b27b840 code cleanup: remove unnecessary new_translator in LoadVoice()
It looks like this was used in situations where both "language" and
"translator" voice options were found. Since bda8b6f76a "translator"
hasn't been supported.
2021-05-22 13:38:03 +03:00
Valdis Vitolins f6d092a9c1 Merge pull request #942 2021-05-18 23:26:07 +03:00
Valdis Vitolins 83f9312130 Merge pull request #930 2021-05-17 18:42:59 +03:00
Valdis Vitolins 68518a6cc9 Merge pull request #940 2021-05-16 14:59:59 +03:00
Christopher Brannon 8810fa330e Fix another out-of-bounds read in SSML parsing.
A malformed tag like <foo could cause espeak to read past
the end of the string.
2021-05-15 15:19:57 -07:00
Juho Hiltunen 2a7080f411 Merge pull request #932 2021-05-15 21:17:50 +03:00
Christopher Brannon 2d7286d571 Fix out-of-bounds read when processing malformed SSML. 2021-05-15 21:12:59 +03:00
Juho Hiltunen d91b7cf288 Rename zh (Mandarin) to cmn across the codebase.
See discussion in #933.
2021-05-11 20:14:54 +03:00
Juho Hiltunen 875174c3e9 Rename zhy (Cantonese) to yue across the codebase.
See discussion in #933.
2021-05-11 19:19:55 +03:00
Reece H. Dunn 379403d102 Merge tag 'de5e36b4ad69c4acfdd728b2ca3e0e472d91afd1'
ucd-tools 11.0.0.1
2021-05-04 18:56:51 +01:00
Reece H. Dunn 2b2eac1d8b Fix the note in case.py/case.c. 2021-05-04 17:54:15 +01:00
Reece H. Dunn 1a895f37b9 Fix running the tests with -fsanitize=address. 2021-05-04 17:51:28 +01:00
Philippe Antoine 2cd39373eb Exlcude ucd-tools overread from this PR 2021-05-04 16:29:29 +02:00
Philippe Antoine 39e6a58659 Take comments into account 2021-05-04 14:57:53 +02:00
Philippe Antoine 24bfbcfeca Oss-fuzz integration
- fix a buffer overflow in ucd_tolower leading to failure when
compiling with address sanitizer
- force the use of C++ compiler for espeak-ng
- adding a malloc to have a null-terminated string in the fuzz target
- setting (but not overwriting) ESPEAK_DATA_PATH environment
variable inside the fuzz target
2021-05-04 13:12:42 +02:00
Christopher Brannon d8ec91e809 Fix buffer size calculation when initializing output.
With the previous calculation, it was possible for the buffer to be
a byte or two too small to hold all of the data.
2021-05-03 07:59:30 -07:00
John Bowler 18d807d680 Prevent compile-phonemes use of phontab, en_dict
espeak-ng --compile-phonemes generates phontab, but during the
generation it starts by reading the old phontab.  If works just fine,
apart from an error message, if this doesn't exist but if it does exist
it is not clear whether it might end up using old or bad data (e.g.
possibly crashing if phontab is corrupted making it very non-obvious how
to fix the problem...)

The same applies to en_dict as a result of espeak-ng defaulting to the
voice 'en'; again the phontab build works if en_dict is absent but a
spurious message is output.  It's not clear what would happen if someone
tried to build a reduced espeak-ng configuration with just one (non
'en') language.

The fix is to change espeak_ng_CompilePhonemeDataPath to call LoadVoice
with a new flag to indicate the voice structure is just required to
compile phoneme data (I changed the error message as well to make it
clear where it comes from - there are two identical error messages, the
other one is in voices.c)

Within LoadVoice the flag causes LoadVoice to not set a default language
or voicename and to skip loading the old phontab or dictionary (both of
which fail in a git clean -dfx build).

I checked the result by doing a compile from-scratch build sequence with
and without the patch, i.e. I did:

git clean -dfx
./autogen.sh
./configure --prefix=a-test-directory
make
make install

Then I compared the two copies of "a-test-directory" as well as the log
file output:

$ diff -r logs/*
diff -r logs/original/make.log logs/patched/make.log
175,176d174
< Unknown phoneme table: 'en'
< Can't read dictionary file:
'/home/jbowler/src/espeak-ng/master/espeak-ng-data/en_dict'

$ diff --no-dereference -r local.original local.patched
Binary files local.original/bin/speak-ng and local.patched/bin/speak-ng differ
Binary files local.original/lib/libespeak-ng.a and local.patched/lib/libespeak-ng.a differ
Binary files local.original/lib/libespeak-ng.so.1.1.51 and local.patched/lib/libespeak-ng.so.1.1.51 differ

So the change has not altered phontab or any of the other generated
files, only the binaries as would be expected.  (Note that I am
comparing truely clean builds; what you get if you download the source
and build from scratch.  This is the standard approach for people who
build for distribution.)

Signed-off-by: John Bowler <jbowler@acm.org>
2021-04-29 08:23:53 -07:00
John Bowler 02199ec016 Fix crash in voices.c:SetVoiceScores
The only way (in Dec. 2019) to get espeak_ListVoices to actually list
all the voices, including variants and mbrola voices used to be to pass
a non-null voice selector with a null language pointer.  This still
seems to be supported in SetVoiceScores, which still checks for a null
language (see the check right at the top), however new code has been added
for a pseudo voice "all" lower down which seems to do the same thing but
crashes with null.  This change allows "old" code to continue working.

Signed-off-by: John Bowler <jbowler@acm.org>
2021-04-27 16:27:55 -07:00
Juho Hiltunen 467f3f565f fi: change decimal number behavior
93d3c67df accidentally changes number handling for finnish.

D_FRACTION2 seems to match finnish number standards. It causes the
decimals to be read as numbers instead of individual digits: 12,12 is
read "twelve point twelve" instead of "twelve point one two".

It is undocumented so it might cause regressions as well.
2021-04-20 19:40:58 +03:00
katrihiovainandSebastien Le Maguer 93d3c67df6 smj: Support for new language Lule Saami
Co-authored-by: Sebastien Le Maguer <lemagues@tcd.ie>
2021-04-10 13:54:41 +03:00
Juho Hiltunen c4740b3053 New language option lowercaseSentence
When set in a language file, a period followed by a lower case letter is
detected as end of sentence. Normal behavior is to require a capital
letter.
2021-04-05 19:29:18 +03:00
Reece H. Dunn e6880b27de [#891]: Fix building the Arabic dictionary on windows. 2021-03-24 18:07:39 +00:00
Reece H. Dunn a0b0f58cf5 [#864]: Fix installing the Japanese language on windows. 2021-03-24 17:58:55 +00:00
Juho Hiltunen 0ed9c91520 bugfix: allow both SSSML <audio> and soundicon punctuation
All sound file information goes to soundicon_tab. The contents of the files are not
loaded to memory before they are needed for synthesis.

This removes N_SOUNDICON_SLOTS that divided soundicon_tab into two
parts for unknown reasons.

TODO: LoadConfig() is currently undocumented. The logic should be
moved to LoadVoice() and documented.
2021-03-21 18:53:42 +02:00
Juho Hiltunen 6e197d967e code cleanup: move soundicon logic to a new file
Soundicons are used for external audio with SSML <audio> tag and for
replacing punctuation names with sound files in LoadConfig().

Currently there's a bug wih soundicon slots: if both LoadConfig and
<audio> are used, the punctuation reserves all slots and no sound from
<audio> is played.
2021-03-21 18:53:05 +02:00
Juho Hiltunen e2bd52c845 code cleanup: remove unused PHONEME_LIST->postpause 2021-03-21 12:11:22 +02:00
Juho Hiltunen 1724f79528 code cleanup: remove unnecessary current_phoneme_table
The SelectPhonemeTable(voice->phoneme_tab_ix) has no effect for tests.
Passing other values here breaks tests. That means that the relevant
calls SelectPhonemeTable() are already made in other functions.

voice->phoneme_tab_ix is set in LoadVoice().
2021-03-21 11:20:45 +02:00
Juho Hiltunen 8ce104a315 code cleanup: remove wavefile_ix, move wavefile_amp
wavefile_ix is always equal to fmt_params->wav_addr.

wavefile_amp is only used once  so it can be set right
before calling DoSample2().
2021-03-20 20:29:33 +02:00
Juho Hiltunen aa62682869 code cleanup: simplify speed.fast_settings.
speed.fast_settings[] was introduced in 7b2eecc724 to be used with
Sonic. Looks like after 7b2eecc724 the code related to everything
except fast_settings[0] was removed.

Might be that speed.fast_settings[0] is also irrelevant and could be
removed.
2021-03-13 20:46:40 +02:00
Juho Hiltunen 74ebdb4126 code cleanup: remove unused speed.loud_consonants
It is set but never used.
2021-03-12 22:16:47 +02:00