Debian Codegraph @

debian/patches/punct

raw
1 https://github.com/linux-speakup/espeakup/pull/50
2
3 commit 078010fc609df08b1a837c26c7db72f71a450660
4 Author: Samuel Thibault <[email protected]>
5 Date: Mon Aug 15 23:41:52 2022 +0200
6
7 set_punctuation: Fix punctuation levels values
8
9 They do not actually follow the espeak values (and have no reason to,
10 anyway).
11
12 diff --git a/src/espeak.c b/src/espeak.c
13 index 135c6b5..b3e96a5 100644
14 --- a/src/espeak.c
15 +++ b/src/espeak.c
16 @@ -108,12 +108,31 @@ static espeak_ERROR set_punctuation(struct synth_t *s, int punct,
17 enum adjust_t adj)
18 {
19 espeak_ERROR rc;
20 + espeak_PUNCT_TYPE espeak_punct;
21
22 if (adj == ADJ_DEC)
23 punct = -punct;
24 if (adj != ADJ_SET)
25 punct += s->punct;
26 - rc = espeak_SetParameter(espeakPUNCTUATION, punct, 0);
27 +
28 + switch (punct) {
29 + case 0:
30 + espeak_punct = espeakPUNCT_NONE;
31 + break;
32 + case 1:
33 + espeak_punct = espeakPUNCT_SOME;
34 + break;
35 + case 2:
36 + /* XXX: approximation */
37 + espeak_punct = espeakPUNCT_SOME;
38 + break;
39 + case 3:
40 + default:
41 + espeak_punct = espeakPUNCT_ALL;
42 + break;
43 + }
44 +
45 + rc = espeak_SetParameter(espeakPUNCTUATION, espeak_punct, 0);
46 if (rc == EE_OK)
47 s->punct = punct;
48 return rc;