#define TTS_TAG_VOICE_TYPE_CHILD "child"
#define TTS_MAX_TEXT_SIZE 2000
+#define VOLUME_BASE_VALUE 1000.0
static xmlDocPtr g_config_doc = NULL;
char g_engine_id[128] = {0,};
} else if (0 == xmlStrcmp(cur->name, (const xmlChar *)TTS_TAG_CONFIG_BACKGROUND_VOLUME_RATIO)) {
xmlChar *key = xmlNodeGetContent(cur);
if (NULL != key) {
- temp->bg_volume_ratio = atof((char*)key);
+ temp->bg_volume_ratio = atoi((char*)key) / VOLUME_BASE_VALUE;
xmlFree(key);
key = NULL;
} else {
{
char temp[10];
memset(temp, '\0', 10);
- snprintf(temp, 10, "%lf", value);
+ snprintf(temp, 10, "%d", (int)(value * VOLUME_BASE_VALUE));
if (0 != __set_value_into_configuration(TTS_TAG_CONFIG_BACKGROUND_VOLUME_RATIO, temp)) {
return -1;
if (0 != xmlStrcmp(key_old, key_new)) {
SLOG(LOG_DEBUG, TAG_TTSCONFIG, "Old bg volume ratio(%s), New bg volume ratio(%s)",
(char*)key_old, (char*)key_new);
- *bg_volume_ratio = atof((char*)key_new);
+ *bg_volume_ratio = atoi((char*)key_new) / VOLUME_BASE_VALUE;
}
xmlFree(key_new);
key_new = NULL;
<voice-type>female</voice-type>
<speech-rate>8</speech-rate>
<pitch>8</pitch>
- <background-volume-ratio>0.4</background-volume-ratio>
+ <background-volume-ratio>400</background-volume-ratio>
</tts-config>