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: 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.
Valgrind reports
==20307== Invalid write of size 1
==20307== at 0x4E856FE: Wavegen.part.1 (wavegen.c:880)
==20307== by 0x4E86682: Wavegen (wavegen.c:670)
==20307== by 0x4E86682: Wavegen2 (wavegen.c:1235)
==20307== by 0x4E86682: WavegenFill2 (wavegen.c:1317)
==20307== by 0x4E86CA7: WavegenFill (wavegen.c:1398)
==20307== by 0x4E7093F: Synthesize (speech.c:442)
==20307== by 0x4E712E0: sync_espeak_Synth (speech.c:549)
==20307== by 0x4E8A5C0: process_espeak_command (espeak_command.c:317)
==20307== by 0x4E8B387: say_thread (fifo.c:333)
==20307== by 0x50E85A9: start_thread (pthread_create.c:463)
==20307== by 0x53F5CBE: clone (clone.S:95)
==20307== Address 0xad5e1bd is 0 bytes after a block of size 2,205 alloc'd
==20307== at 0x4C2CABF: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==20307== by 0x4C2EE04: realloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==20307== by 0x4E70CFC: espeak_ng_InitializeOutput (speech.c:286)
==20307== by 0x4E6176E: espeak_Initialize (espeak_api.c:67)
==20307== by 0x10A5D8: initialize_espeak (espeak.c:303)
==20307== by 0x109D1D: main (espeakup.c:201)
==20307==
Indeed, the out_ptr >= out_end test is not enough: it only checks that
one byte can fit the buffer, while klatt and wavegen produce two bytes.
This reverts commits 0cc0300328 to
38d15f8f90.
The 0cc03003 commit breaks MBROLA voice support. As such, there
may be other breakages in those commits.
Fix: Flush stderr() after espeak_CompileDictionary().
Fix: parallel formant parameters for Klatt synthesizer.
Changes for Malayalam numbers.
Language changes: en-us, nl, pt, sl, ta, ur.
git-svn-id: https://espeak.svn.sourceforge.net/svnroot/espeak/trunk@359 d46cf337-b52f-0410-862d-fd96e6ae7743
Indian languages: change [t.#].
lang=hy,: Change letter names.
Add voice variant Klatt4 with a sawtooth voicing waveform.
Fix problem in 1.47.10a with 'kr' and 'pr' in some languages.
git-svn-id: https://espeak.svn.sourceforge.net/svnroot/espeak/trunk@357 d46cf337-b52f-0410-862d-fd96e6ae7743
Fixed bug where SSML voice change didn't remember an initially specified Klatt variant.
Removed some unused variables and redundant initializations.
Patch to fix a spike from Klatt function setzeroabc()
git-svn-id: https://espeak.svn.sourceforge.net/svnroot/espeak/trunk@275 d46cf337-b52f-0410-862d-fd96e6ae7743
klatt.cpp: fix a sound spike in setzeroabc when f == 0.
If setzeroabc is passed f == 0, rp->a will be set to 0 and when
the coefficients get inverted (a'=1/a, b'=b/a, c'=c/a) then a',
b' and c' get set to INF. This results in an audible sound spike
when these resonators get used.
Found when investigating an issue in klatt with example1.par when
using the cascade synthesis mode.
Bug: https://github.com/rhdunn/klatt/issues/1.
Indicate language changes in IPA phoneme output.
Phoneme definitions FMT(), second parameter is amplitude percentage.
Phoneme definitions CALL(), If phoneme type is not defined, copy the static attributes from the called phoneme.
Unpronouncable word check: stop when an apostrophe is reached.
git-svn-id: https://espeak.svn.sourceforge.net/svnroot/espeak/trunk@250 d46cf337-b52f-0410-862d-fd96e6ae7743
espeakedit --compile also compiles the intonation data
Added feature to produce phonemes as International Phonetic Alphabet.
phoneme definitions: Added "ipa" instruction to specify IPA phoneme name.
When spelling as individual characters, calculate the stress position for each character name.
git-svn-id: https://espeak.svn.sourceforge.net/svnroot/espeak/trunk@249 d46cf337-b52f-0410-862d-fd96e6ae7743