Commit Graph
1788 Commits
Author SHA1 Message Date
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
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 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
jaacoppi 4c3fe183dd Merge pull request #888
Set number handling on by default
2021-03-12 16:35:38 +02:00
Juho Hiltunen bda8b6f76a code cleanup: remove unnecessary voice option translator
See commit message for 23a4d88f.

This commit fixes cmn and yue.
CalcPitches_Tone() now accepts cmn for translator_name.
SelectTranslator() now has a case for yue instead of zhy.
2021-03-08 18:18:14 +02:00
Juho Hiltunen d260562b7e Revert "code cleanup: remove unnecessary voice option translator"
This reverts commit 23a4d88f6b.

Breaks tests for cmn.
2021-03-07 13:34:05 +02:00
Juho Hiltunen 23a4d88f6b code cleanup: remove unnecessary voice option translator
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.
2021-03-07 12:58:23 +02:00
Juho Hiltunen 6a43f8c984 code cleanup: remove dead code for Divehi (dv)
The language is not supported and apparently never has been.
2021-03-05 17:21:08 +02:00
jaacoppi a54824c9e5 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
2021-03-04 19:13:09 +02:00
Juho Hiltunen b0a7ef2789 add macro L4() needed by Klingon (piqd) 2021-03-04 18:54:43 +02:00
Valdis Vitolins 2d633b72cd Merge pull request #886 2021-03-02 20:56:52 +02:00
Juho Hiltunen 326b63132f bugfix: force bitrate to 16 for SSML <audio>.
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.
2021-03-02 06:26:36 +02:00
Juho Hiltunen 40613d5b67 code cleanup: remove ssml_ignore_l_angle.
It is supposed to be used with SSML for reading < (&lt;) and & (&amp;)
when invoking espeak-ng --punct -m.

However, it looks like the code is dead since removing it doesn't fail
the ssml reference test.
2021-02-28 20:17:16 +02:00
Juho Hiltunen 19e2f697f6 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.
2021-02-25 19:33:09 +02:00
Juho Hiltunen cc5b1e1119 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
2021-02-25 18:01:52 +02:00
Juho Hiltunen d1332d7f35 code cleanup: remove unnecessary text_buf2 2021-02-25 17:17:19 +02:00
Juho Hiltunen 5d92b336f5 code cleanup: remove unnecessary pointer assignment and enum value.
- V_ALPHABET2 is a leftover from 2f8f125.
- langopts assignment is unnecessary since it's not used later in the
function.
2021-02-23 17:23:04 +02:00
Juho Hiltunen 1243937334 code cleanup: remove unused width2.
It is set but never used.
2021-02-22 18:24:27 +02:00
Juho Hiltunen cffdfb837b code cleanup: move function declarations from speech.h to new file mnemonics.h
This adds a corresponding header file for mnemonics.c that was introduced in d5d93be.
2021-02-22 16:56:19 +02:00
Juho Hiltunen 0cf3ee564c 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.
2021-02-21 15:01:29 +02:00
Juho Hiltunen 1aae299ae2 code cleanup: remove unused REDUCE_T
There is no code related to it.
2021-02-07 19:05:07 +02:00
Juho Hiltunen 2c93961ebe code cleanup: remove unused stress_amps_r
It is set but never used.
2021-02-07 18:54:31 +02:00
freddii 61efed30fa fixed spelling mistakes 2021-01-13 01:55:34 +01:00
Juho Hiltunen 5f1a4f9cbd Revert "maintainability: pass n_ph_list2 and ph_list2 to MakePhonemeList() and SubstitutePhonemes() instead of using globals"
This reverts commit f0c345eb6a.

Fixes #824.
2020-12-30 12:02:02 +02:00
Juho Hiltunen aafa55cbbc code cleanup: remove unnecessary code related to LOPT_CAPS_IN_WORD
translate.h gives two settings to LOPT_CAPS_IN_WORD, but only one of them is actually ever used.
2020-12-28 11:30:08 +02:00
Juho Hiltunen 07c8ad3f7b jbo: remove unnecessary lojban related code in ReadClause()
It is enough to have the logic in dictsource/jbo_*.

Thanks to xunsku @ irc.freenode.org
2020-12-26 20:07:40 +02:00
datajake1999 073a4188a8 Add support for speechPlayer aspirationAmplitude parameter in voice files. 2020-12-09 02:41:15 -08:00
datajake1999 9303e17a48 Fixed speechPlayer licensing issue. 2020-12-07 02:52:27 -08:00
datajake1999 5e502661d6 Add speechPlayer Klatt implementation as Klatt 6. 2020-12-06 08:34:38 -08:00
datajake1999 a90a0fb2bd Applied Klatt fixes from NV Access and added Edward variant. 2020-11-20 02:59:43 -08:00