Commit Graph
82 Commits
Author SHA1 Message Date
Yury Popov 89b2a55ea4 code cleanup: remove static from WordToString 2022-11-19 17:29:16 +03:00
Yury Popov 2929b9e199 code cleanup: use statics and consts when possible 2022-11-18 17:48:04 +03:00
Yury Popov 3da51991f8 code cleanup: reduce global externs 2022-11-15 22:38:22 +03:00
Juho Hiltunen f23ff88755 cleanup: reduce variable scopes in synthdata.c 2022-10-30 10:11:53 +02:00
Juho Hiltunen c05690be34 cleanup: move LoadConfig to langopts.c
LoadConfig() should be refactored to support both voice and language options set
in LoadVoice() and LoadLanguageOptions().
2022-10-10 21:36:25 +03:00
Juho Hiltunen c92180f918 cleanup: move n_tunes and tunes to where they are used 2022-10-09 16:38:53 +03:00
Juho Hiltunen c4d8976fbc code cleanup: Add new source file common.h for misc functions. 2022-09-03 21:19:37 +03:00
Samuel Thibault 24e1eaa0cc Mark static arrays undefined when they are reused
So valgrind can potentially catch e.g. missing \0.
2022-06-09 09:48:43 +02:00
Samuel Thibault a660fc04cc Add more const qualifiers on static arrays
So we know they are just tables, get protected from overflows, and get shared between processes
2022-06-09 08:43:50 +02:00
Samuel Thibault 1228094127 Mark re-used phoneme_tab array as undefined
And make sure that the unfilled entries are NULL to catch any spurious
reference.

Also fix some missing phoneme table switch according to language
changes.
2022-04-13 23:24:13 +02: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 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 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 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 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
Reece H. Dunn 9344dab0c3 Revert "maintainability: pass seq_len_adjust to LookupSpect() instead of using globals"
This reverts commit d08b8e43ca.

This commit causes gcc-4.8 to output a different SHA1 hash on the
language-phonemes test for `af` (the first language tested). It
does not break on clang or on gcc-7 so may be a compiler bug,
however the Travis CI build server is using it on Ubuntu Trusty
(14.04 LTS) and so may other older OSes.
2018-03-25 13:34:52 +01:00
Juho Hiltunen d08b8e43ca maintainability: pass seq_len_adjust to LookupSpect() instead of using globals 2018-03-25 12:41:01 +03:00
Juho Hiltunen d196d93ed5 maintainability: move variables to files where they are used, allowing removal of unnecessary extern declarations 2018-03-24 15:05:23 +02:00
Juho Hiltunen 1bad240de8 maintainability: remove some unused variables and unnecessary extern declarations 2018-03-24 15:03:48 +02:00
Juho Hiltunen 07160f9286 headers: add new file synthdata.h with declarations of functions in synthdata.c 2018-03-10 08:23:24 +02:00
Juho Hiltunen 706df97b20 headers: add new file readclause.h with declarations of functions in readclause.c 2018-03-10 07:18:07 +02:00
Juho Hiltunen d1fd650219 Replace references to USHORT, DOUBLEX and UCHAR with unsigned short, double and unsigned char.
This makes the codebase more consistent. Including speech.h is not necessary anymore in some files. Includes have been removed.
2018-03-09 21:08:38 +02:00
Juho Hiltunen 78749f14f8 readability fix: use boolean instead of 0 and 1 for loop control 2018-02-17 18:17:00 +02:00
Juho Hiltunen da287fb851 Unify terminology for stress
synthesize.h now contains the definitions STRESS_IS_... that should be used with code related to syllable stress.

Note that isBreak and other defines were renumbered so that stress definitions could have values 0-6.

Possible TODOs:
1. Unify with terms used with phonemes, i.e. keywords like isDiminished in compiledata.c and stress_type in phsource/phonemes
2. Add functionality and documentation about STRESS_IS_PRIORITY and STRESS_IS_EMPHASIZED
2018-01-14 15:26:03 +02:00
Juho Hiltunen 4f56345fb5 Use stdbool instead of int (Issue #8)
See issue #8, https://github.com/espeak-ng/espeak-ng/issues/8

There might still be some ints that could be changed to boolean.

Possible regressions in fifo.c:
int fifo_is_busy() and int fifo_is_command_enabled() used to return an int. Now they return a boolean. This might cause problems on systems where stdbool true/false is something else than 1/0.
2017-12-09 17:34:05 +02:00
Reece H. Dunn b5c415a98d Rename OPCODE_ to INSTN_. 2017-10-28 12:38:39 +01:00
Reece H. Dunn 6acec43043 synthesize.c: Fix -Wmissing-prototypes warnings. 2017-10-11 07:16:43 +01:00
Reece H. Dunn 74f9f5e34b wavegen.c: Fix -Wmissing-prototypes warnings. 2017-10-10 21:37:46 +01:00
Reece H. Dunn d89fa59bed Enable and fix -Wunused-variable warnings. 2017-10-05 07:23:17 +01:00
Reece H. Dunn 921229259d Use int to store the value from GetFileLength.
This fixes the clang warning:

    comparison of unsigned expression < 0 is always false
    [-Wtautological-compare]

Reported by Reef Turner <reef@nvaccess.org>
2017-07-26 19:50:03 +01:00
Reece H. Dunn 9af96da469 Make the encoding.h API public. 2017-05-02 18:40:16 +01:00
Reece H. Dunn 7c16ac543c Use the text decoder API in readclause.c. 2017-03-31 13:17:37 +01:00
Reece H. Dunn 71c010b712 Remove unused wchar.h and wctype.h includes. 2017-02-10 08:03:40 +00:00
Reece H. Dunn df6a2228b7 Use -EISDIR instead of -2 in GetFileLength for directories. 2017-02-04 16:02:56 +00:00
Reece H. Dunn f2bb482782 Use OPCODE for the RETURN and CONTINUE opcodes. 2017-01-29 10:29:48 +00:00
Reece H. Dunn b937d37e93 Use the stress condition values in StressCondition. 2017-01-29 10:14:10 +00:00
Reece H. Dunn 8338cdd250 Better document the other condition checks (isDiminished, etc.). 2017-01-29 10:09:16 +00:00
Reece H. Dunn 5d2e2a2f8f Use the place of articulation constants to specify the place-based conditions. 2017-01-29 00:29:17 +00:00
Reece H. Dunn f0d4a98b96 Use an explicit is phoneme type constant to specify the type-based conditions. 2017-01-29 00:09:54 +00:00
Reece H. Dunn 98703c30de Use the phflag bit offset constants to specify the phflag-based conditions. 2017-01-29 00:04:44 +00:00
Reece H. Dunn 5c96ad2359 Remove unused phoneme flags. 2017-01-28 23:24:53 +00:00
Reece H. Dunn 5600019a54 Remove unused conditional tests. 2017-01-28 21:16:08 +00:00
Reece H. Dunn 6a0ea584ea Don't store the unused phoneme equivalence tables in the phoneme data files. 2017-01-27 20:44:06 +00:00
Reece H. Dunn a091c20852 Remove the unused isSeqFlag1 logic checks. 2017-01-25 23:44:19 +00:00