Commit Graph
121 Commits
Author SHA1 Message Date
Yury Popov 504ab4937d code cleanup: static current_voice_selected 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
Yury Popov 1e279d3cb8 Add PRNG and use it instead of rand() 2022-11-15 09:58:29 +03:00
Juho Hiltunen 1de9f4b52c Revert "cleanup: reduce code duplication with a new function"
This reverts commit 8021528f5e.

Failing on CI/CD.
2022-10-30 10:56:59 +02:00
Juho Hiltunen 8021528f5e cleanup: reduce code duplication with a new function
StatusCreateTerminatedMsg.

This is not covered by current tests.
2022-10-30 10:12:11 +02:00
Yury Popov 9b3b916163 Add ng API to enable phoneme events 2022-10-17 18:48:23 +03: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
Yury Popov cd0dd0900f Do not create audio out if not required 2022-09-05 00:42:42 +03:00
Juho Hiltunen c4d8976fbc code cleanup: Add new source file common.h for misc functions. 2022-09-03 21:19:37 +03:00
Juho Hiltunen d80f1a80a2 Use ESPEAKNG_DEFAULT_VOICE instead of hard coded "en".
This will make it easier to set a default voice other than
English. This is important for cases when a language will fall back to
the default voice.

Some references to L('e', 'n') still need to be changed.
2021-08-10 19:57:53 +03:00
Reece H. Dunn 5791bf28de Fix -Wunused-parameter warnings. 2021-05-30 17:10:25 +01: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
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 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 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
Valdis Vitolins 238427184a Fix issue #772: setting buffer size to 50ms leads to truncated mbrola-fr4 output 2020-06-14 22:09:52 +03:00
Juho Hiltunen 520a30e0b0 code cleanup: use existing defines espeakRATE_MINIMUM, espeakRATE_NORMAL and espeakRATE_MAXIMUM. 2018-10-06 11:34:25 +03:00
Samuel Thibault d844a47804 Make it possible to restart speech even when audio open failed once
When notably the audio card is busy, we should report the issue to the
application, but still permit the application to retry submitting text
to synth, and eventually succeed to open it.

This change simply fixes the update of the out_samplerate variable to track
whether audio is open, and if not when text is submitted by the application,
try again to open it.
2018-05-03 21:27:02 +02: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
Reece H. Dunn d23735ae1b Release the translator memory in espeak{_ng,}_Terminate. 2018-03-22 07:26:22 +00:00
Juho Hiltunen 29cba35a9e headers: add new file mbrola.h with declarations of functions in compilembrola.c and synth_mbrola.c 2018-03-11 11:44:48 +02:00
Juho Hiltunen f00ff91fe4 headers: add new file wavegen.h with declarations of functions in wavegen.c 2018-03-11 11:27:56 +02:00
Juho Hiltunen 9012f3f0bf headers: continue with synthdata.h 2018-03-10 13:54:58 +02:00
Juho Hiltunen 231a1d0944 headers: add new file dictionary.h with declarations of functions in dictionary.c 2018-03-10 12:47:02 +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 78749f14f8 readability fix: use boolean instead of 0 and 1 for loop control 2018-02-17 18:17:00 +02:00
Reece H. Dunn e6c75fa350 speech.c: Fix -Wmissing-prototypes warnings. 2017-10-11 07:20:19 +01:00
Reece H. Dunn 74f9f5e34b wavegen.c: Fix -Wmissing-prototypes warnings. 2017-10-10 21:37:46 +01:00
Reece H. Dunn 5c14e92f6b voices.c: Fix -Wmissing-prototypes warnings. 2017-10-06 07:23:57 +01:00
Reece H. Dunn 8585b0b47d Fix the return status code from Synthesize when the voices cannot be found. 2017-08-19 12:27:39 +01:00
Reece H. Dunn fbd2e679fc Don't crash if loading the default voice fails. 2017-05-21 12:44:10 +01:00
Reece H. Dunn dced9f58fd Clean up the decoder memory in espeak_Terminate. 2017-05-21 12:07:15 +01:00
Reece H. Dunn 63e2826753 Ensure that the old translator is not used after calling espeak_Terminate. 2017-05-21 12:01:46 +01:00
Reece H. Dunn ae6116bf97 Fix calling espeak_Synth without first setting a voice, with tests. 2017-05-21 10:47:47 +01:00
Reece H. Dunn 6ab1314843 Move outbuf_size to where it is actually used. 2017-05-21 10:02:27 +01:00
Reece H. Dunn 9fc2efb1fa Don't re-initialize my_audio if espeak_ng_InitializeOutput is called multiple times. 2017-05-21 09:49:35 +01:00
Reece H. Dunn 9af96da469 Make the encoding.h API public. 2017-05-02 18:40:16 +01:00
Reece H. Dunn 62d4aff9a9 Remove the now unused option_multibyte variable. 2017-04-01 15:12:49 +01:00
Reece H. Dunn ec8a7b810f Use the text decoder object at the top-level Synthesize/espeak_TextToPhonemes call, not in TranslateClause. 2017-04-01 15:11:01 +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 8933185de4 Remove the unused f_in argument to the Read/Translate/SpeakNextClause functions. 2017-03-31 07:13:36 +01:00
Reece H. Dunn 3ce7fab7db Return the actual error from GetFileLength instead of 0. 2017-02-04 16:03:56 +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 dee3799f82 issue #172: flush audio on cancel requests.
This is a partial fix for an audio regression. The other part of
the fix requires a change in pcaudiolib to reopen the audio device
on flush requests for affected audio drivers/devices.
2017-01-24 07:24:29 +00:00
Reece H. Dunn d42ba93959 Don't use the HOME directory as the espeak-ng-data path. 2017-01-20 18:27:10 +00:00
Reece H. Dunn 773da20c16 Support using home (data) paths other than 'espeak-ng-data'. 2017-01-19 22:04:20 +00:00
Reece H. Dunn 96e34565ed Use a default buffer length of 60mS to fix using MBROLA voices. 2017-01-16 19:41:34 +00:00
Reece H. Dunn d828156576 Reduce buffer length to 50mS and don't override it when using eSpeak for audio. 2017-01-12 07:40:14 +00:00
Reece H. Dunn dae9cda060 Revert "issue 172: fix sluggish speech for stopped speech."
This reverts commit f9ab812e00.
2017-01-12 07:14:02 +00:00