Commit Graph
100 Commits
Author SHA1 Message Date
Juho Hiltunen ed37d4533e fix a type in Changelog (Chuvash = cv, not cu) 2021-07-18 11:36:09 +03:00
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 660f1403a2 Update changelog 2021-06-29 15:47:06 +03:00
Juho Hiltunen 38c0bae42f Merge pull request #973 2021-06-29 15:22:50 +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
Juho Hiltunen 4f9664af0a Merge pull request #965 2021-06-12 15:35:12 +03:00
Juho Hiltunen 48971d484c Update changelog 2021-06-12 13:06:52 +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
Juho Hiltunen 16f30f6522 fi: small changes 2021-06-06 16:30:41 +03:00
Juho Hiltunen 92b797a0e1 fi: changes to abbreviations 2021-06-06 16:30:10 +03:00
Juho Hiltunen 67086dc1da fi: add exceptions to doubling with -sti 2021-06-06 16:18:10 +03:00
Juho Hiltunen b513534995 fi: remove the english pronunciation of some loan words 2021-06-06 16:18:10 +03: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
Juho Hiltunen c83d9f19f2 yue: new language yue-latn-jyutping
yue-latn-jyutping assumes latin characters are jyutping.
2021-05-16 20:09:34 +03:00
Juho Hiltunen 4825905835 cmn: handle latin characters as English text.
cmn now handles all latin characters as English.

The old functionality of assuming latin characters are pinyin can be
achieved with new language cmn-Latn-pinyin.
2021-05-16 19:23:34 +03:00
Juho Hiltunen 2a7080f411 Merge pull request #932 2021-05-15 21:17:50 +03:00
Juho Hiltunen 4c7c68d5fe Merge pull request 936 2021-05-15 20:54:23 +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
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
Juho Hiltunen cad1c8e87f ka: End sentences for period followed by a lower case letter.
Useful because capitals are not used in Mkhedruli script.

Uses the new lowercaseSentence setting.
2021-04-05 19:29:18 +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
Juho Hiltunen dbaf6d4012 Update changelog
I forgot to add fa: to previous commit message 4967418.
2021-03-31 21:14:29 +03:00
Juho Hiltunen 1432684245 en: fix dengler and binghamton.
Pronounce dengler and binghamton the same way with and without a capital
letter.

Closes #895.
2021-03-23 18:01:32 +02: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
jaacoppi c315a10109 docs: add details about ordinal numbers 2021-03-20 08:46:45 +02:00
Juho Hiltunen 2d9ef5b5fc tests: test for mbrola voice combined with a voice variant 2021-03-20 08:37:26 +02:00
Juho Hiltunen 53915bf0a7 voice: fix Bad voice attribute warnings.
voice fast is related to speed.fast_settings. Others were errors in
LoadVoice() parsing or commented out code.

Note that some voices are from the original espeak and have comments
that might be outdated.
2021-03-14 08:04:26 +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
Juho Hiltunen 75ea4b0bdf Tests: add tests for voice variants 2021-03-10 21:19:55 +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
Juho Hiltunen 1914d39d9f Update changelog 2021-03-05 06:21:47 +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
Juho Hiltunen f9b52b092a tr: temporarily disable a prefix and suffix rule '.
See issue #875. Words with two ' cause the first part of the word to be
lost.
2021-03-02 18:39: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 0cb4b1b654 docs: add sox as an optional dependency.
using sox for ssml <audio> tag is hardcoded in readclause.c and for
--compile-phonemes in compiledict.c

Currently, --compile-phoneme doesn't need to run sox since the
samplerate for the specific file is correct. There might be a lot of
dead code in compiledata.c
2021-02-27 20:24:44 +02:00
Juho Hiltunen c62921ae0b tests: add tests for ssml <prosody> and <audio>
SSML logic has a bug (#410) where speech parameters are not changed when there's a
sentence elogic nd. The prosody bug test should fail.
2021-02-27 20:24:44 +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 b9eb212217 Temporary workaround for #874
The phonSWITCH bug still exists and needs fixing.
2021-02-22 16:39:45 +02:00
Juho Hiltunen d9a3b532b9 Update CHANGELOG.md 2021-02-21 15:55:53 +02:00
Juho Hiltunen f899cfa49b Merge upll request #881 2021-02-21 15:16:40 +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
Juho Hiltunen b19e801733 Merge pull request #870 2021-01-30 14:55:01 +02:00
Juho Hiltunen 4838b35602 Tests: new test file for command line options
This is intended for testing command line options such as -k 2, --punct
and so on.
2021-01-26 20:57:57 +02:00
Juho Hiltunen 673c12a54e docs: add an explanation to $pause, $brk, $verbextend and $nounf 2021-01-26 20:57:42 +02:00
Juho Hiltunen a36f5573d2 Tests: new test collection for dictionary files.
The file is intended for everything mentioned in docs/dictionary.md.
2021-01-26 20:57:34 +02: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 30214437fc test for #824 2020-12-30 12:01:56 +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 23172c4f74 jbo: add a test for capitals within words (LOPT_CAPS_IN_WORD) 2020-12-28 11:24:26 +02:00
Juho Hiltunen 2636583e31 Update changelog 2020-12-26 20:10:04 +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
Juho Hiltunen 597a8a4555 jbo: Multiple pronunciation fixes.
Thanks to xunsku @ irc.freenode.org
2020-12-26 20:06:45 +02:00
Juho Hiltunen 55eb89ae5d jbo: fix pronunciation of " i" and " .i".
This test is related to the next two lojban commits. Thanks to xunsku @ irc.freenode.org
2020-12-26 20:04:54 +02:00
Juho Hiltunen c9dee003bf better explanation and nicer formatting for the ssml reference test. 2020-08-27 06:12:25 +03:00
Juho Hiltunen 54d93cf2b4 code cleanup: move ssml reference handling logic to a new function ParseSsmlReference()
It's unclear why c2 needs to be set after an entity reference.
2020-08-23 20:43:29 +03:00
Juho Hiltunen 959bf26b6b Add a test for XML/SSML character and entity references 2020-08-23 20:42:47 +03:00
Juho Hiltunen 34657e7ea4 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?
2020-08-23 20:42:24 +03:00
Juho Hiltunen 75d66c89d0 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.
2020-08-23 20:41:52 +03:00
Juho Hiltunen 50f58168e1 code cleanup: remove unused *constcharptr and MakeWawe2() 2020-08-23 20:41:28 +03:00
Juho Hiltunen 0352616de9 code cleanup: remove ununsed ctrl_embedded
It's a duplicate of CTRL_EMBEDDED.
2020-07-24 15:44:03 +03:00
Juho Hiltunen 725bdda564 code cleanup: remove unused variables
this_ph_data, N_WAV_BUF, option.device, harm_sqrt_n,  max_hval, next_pause
2020-07-24 07:29:59 +03:00
Juho Hiltunen 68874a06f1 code cleanup: make NumInstnWords() static 2020-07-24 07:29:59 +03:00
Juho Hiltunen ee944700f8 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
2020-07-24 07:29:47 +03:00
Juho Hiltunen 5d03047c19 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
2020-07-21 16:14:25 +03:00
Juho Hiltunen a4041952c5 code cleanup: remove unused references to f_log
f_log is only used in compiledict.c.
2020-07-21 15:50:39 +03:00
Juho Hiltunen 713e8a9e2c code cleanup: remove unused parameter from SetUpPhonemeTable.
See commit 65847bd251. Bool recursing is not used for
anything anymore. Fixes a (compiler warning.
2020-07-21 15:50:29 +03:00
Juho Hiltunen 65847bd251 code cleanup: remove phoneme_tab_flags
It is memset and set once, but never checked or used for anything.
2020-07-21 12:39:59 +03:00
Juho Hiltunen c0ff3696b9 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().
2020-07-21 12:39:51 +03:00
Juho Hiltunen 992745508e code cleanup: pass voice_t wvoice as a parameter to Wavegen() instead of using a
global
2020-07-21 12:39:41 +03:00
Juho Hiltunen 3b4cca4832 code cleanup: combine Wavegen() and Wavegen2().
Wavegen2() only had one if-statement and then called
    Wavegen(). Wavegen() was never called directly.
2020-07-21 12:39:28 +03:00
Juho Hiltunen 9232f1911e code cleanup: remove unnecessary references to out_start.
Unsigned char *out_start is a global only used in speech.c.
2020-07-21 12:39:20 +03:00
Juho Hiltunen 388be80da7 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.
2020-07-21 12:39:12 +03:00
Juho Hiltunen 1b7c3303ef code cleanup: pass WGEN_DATA wdata as a parameter instead of using a global
Contributes to #68.
2020-07-21 12:39:03 +03:00