[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 4/7] replace EVoiceType with SPDVoiceType
From: |
Christopher Brannon |
Subject: |
[PATCH 4/7] replace EVoiceType with SPDVoiceType |
Date: |
Tue, 02 Nov 2010 18:43:29 +0000 |
Andrei Kholodnyi <andrei.kholodnyi at gmail.com> writes:
> both enums are identical, replace internal EVoiceType enum with
> public SPDVoiceType enum
They most certainly are not identical!
> - NO_VOICE = 0,
When the server sends a setting of
voice=null
to the module, NO_VOICE is used to represent it in the code.
The server sends voice=null whenever you set synthesis_voice.
> -EVoiceType
> +SPDVoiceType
> str2EVoice(char* str)
> {
> - EVoiceType voice;
> *SNIP*
> -
> > - else voice = NO_VOICE;
> + else voice = -1;
Now let's look at do_set, from src/modules/module_utils.c:
char*
do_set(void)
{
/* SNIP MUCH */
if(!strcmp(cur_item, "voice")){
ret = str2EVoice(cur_value);
if (ret != -1) msg_settings.voice_type = ret;
else err = 2;
}
/* SNIP MORE */
if (err == 2) return g_strdup("303 ERROR INVALID PARAMETER OR VALUE");
So do_set will always fail if the server sends voice=null. In other
words, it fails when you try to set the synthesis voice. The simple
solution is seemingly to remove the check for -1.
-- Chris
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL:
<http://lists.freebsoft.org/pipermail/speechd/attachments/20101102/f64d34e7/attachment.pgp>
- [PATCH 4/7] replace EVoiceType with SPDVoiceType,
Christopher Brannon <=
- [PATCH 4/7] replace EVoiceType with SPDVoiceType, William Hubbs, 2010/11/02
- [PATCH 4/7] replace EVoiceType with SPDVoiceType, Andrei . Kholodnyi, 2010/11/02
- [PATCH 4/7] replace EVoiceType with SPDVoiceType, Christopher Brannon, 2010/11/03
- [PATCH 4/7] replace EVoiceType with SPDVoiceType, Andrei Kholodnyi, 2010/11/03
- [PATCH 4/7] replace EVoiceType with SPDVoiceType, Andrei Kholodnyi, 2010/11/04
- [PATCH 4/7] replace EVoiceType with SPDVoiceType, Christopher Brannon, 2010/11/04
- [PATCH 4/7] replace EVoiceType with SPDVoiceType, Andrei Kholodnyi, 2010/11/04
- [PATCH 4/7] replace EVoiceType with SPDVoiceType, Tomas Cerha, 2010/11/05
- [PATCH 4/7] replace EVoiceType with SPDVoiceType, Andrei . Kholodnyi, 2010/11/05