Reduce log while waiting for comming synthesized pcm data
[platform/core/uifw/tts.git] / common / tts_defs.h
1 /*
2 *  Copyright (c) 2011-2016 Samsung Electronics Co., Ltd All Rights Reserved
3 *  Licensed under the Apache License, Version 2.0 (the "License");
4 *  you may not use this file except in compliance with the License.
5 *  You may obtain a copy of the License at
6 *  http://www.apache.org/licenses/LICENSE-2.0
7 *  Unless required by applicable law or agreed to in writing, software
8 *  distributed under the License is distributed on an "AS IS" BASIS,
9 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10 *  See the License for the specific language governing permissions and
11 *  limitations under the License.
12 */
13
14
15 #ifndef _TTS_DEFS_H__
16 #define _TTS_DEFS_H__
17
18 /* For multi-user support */
19 #include <tzplatform_config.h>
20 #include <vconf.h>
21
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25
26 /******************************************************************************************
27 * Definition for IPC
28 *******************************************************************************************/
29 #define TTS_SERVER_ENGINE_DEFAULT "org.tizen.tts-engine-default"
30
31 #define TTS_CLIENT_SERVICE_NAME         "org.tizen.tts"
32 #define TTS_CLIENT_SERVICE_OBJECT_PATH  "/org/tizen/tts"
33 #define TTS_CLIENT_SERVICE_INTERFACE    "org.tizen.tts"
34
35 #define TTS_SERVER_SERVICE_NAME         "org.tizen.voice.ttsserver"
36 #define TTS_SERVER_SERVICE_OBJECT_PATH  "/org/tizen/voice/ttsserver"
37 #define TTS_SERVER_SERVICE_INTERFACE    "org.tizen.voice.ttsserver"
38
39 #define TTS_NOTI_SERVER_SERVICE_NAME            "org.tizen.voice.ttsnotiserver"
40 #define TTS_NOTI_SERVER_SERVICE_OBJECT_PATH     "/org/tizen/voice/ttsnotiserver"
41 #define TTS_NOTI_SERVER_SERVICE_INTERFACE       "org.tizen.voice.ttsnotiserver"
42 //#define TTS_NOTI_SERVER_MODE                "-noti"
43
44 #define TTS_SR_SERVER_SERVICE_NAME              "org.tizen.voice.ttssrserver"
45 #define TTS_SR_SERVER_SERVICE_OBJECT_PATH       "/org/tizen/voice/ttssrserver"
46 #define TTS_SR_SERVER_SERVICE_INTERFACE         "org.tizen.voice.ttssrserver"
47 //#define TTS_SR_SERVER_MODE                  "-sr"
48
49 #define TTS_INTERRUPT_SERVER_SERVICE_NAME               "org.tizen.voice.ttsinterruptserver"
50 #define TTS_INTERRUPT_SERVER_SERVICE_OBJECT_PATH        "/org/tizen/voice/ttsinterruptserver"
51 #define TTS_INTERRUPT_SERVER_SERVICE_INTERFACE          "org.tizen.voice.ttsinterruptserver"
52 #define TTS_INTERRUPT_SERVER_MODE                   "-interrupt"
53
54 /******************************************************************************************
55 * Message Definition for APIs
56 *******************************************************************************************/
57 #define TTS_BUNDLE_METHOD "method"
58 #define TTS_BUNDLE_MESSAGE "message"
59 #define TTS_BUNDLE_UTTID "uttid"
60 #define TTS_BUNDLE_REASON "reason"
61 #define TTS_BUNDLE_ERR_MSG "err_msg"
62 #define TTS_BUNDLE_CREDENTIAL_NEEDED "credential_needed"
63
64 #define TTS_METHOD_HELLO                "tts_method_hello"
65 #define TTS_METHOD_HELLO_SYNC       "tts_method_hello_sync"
66 #define TTS_METHOD_INITIALIZE           "tts_method_initialize"
67 #define TTS_METHOD_FINALIZE             "tts_method_finalilze"
68 #define TTS_METHOD_SET_MODE     "tts_method_set_mode"
69 #define TTS_METHOD_GET_SUPPORT_VOICES   "tts_method_get_support_voices"
70 #define TTS_METHOD_GET_CURRENT_VOICE    "tts_method_get_current_voice"
71 #define TTS_METHOD_ADD_TEXT             "tts_method_add_text"
72 #define TTS_METHOD_PLAY                 "tts_method_play"
73 #define TTS_METHOD_STOP                 "tts_method_stop"
74 #define TTS_METHOD_PAUSE                "tts_method_pause"
75 #define TTS_METHOD_PLAY_PCM             "tts_method_play_pcm"
76 #define TTS_METHOD_STOP_PCM             "tts_method_stop_pcm"
77 #define TTS_METHOD_ADD_PCM              "tts_method_add_pcm"
78
79 #define TTS_METHOD_SET_PRIVATE_DATA     "tts_method_set_private_data"
80 #define TTS_METHOD_GET_PRIVATE_DATA     "tts_method_get_private_data"
81 #define TTS_METHOD_SET_CREDENTIAL       "tts_method_set_credential"
82
83 #define TTSD_METHOD_HELLO               "ttsd_method_hello"
84 #define TTSD_METHOD_UTTERANCE_STARTED   "ttsd_method_utterance_started"
85 #define TTSD_METHOD_UTTERANCE_COMPLETED "ttsd_method_utterance_completed"
86 #define TTSD_METHOD_ERROR               "ttsd_method_error"
87 #define TTSD_METHOD_SET_STATE           "ttsd_method_set_state"
88
89
90 /******************************************************************************************
91 * Defines for configuration
92 *******************************************************************************************/
93
94 #define TTS_CONFIG_BASE                 tzplatform_mkpath(tzplatform_getid("TZ_USER_HOME"), "/share/.voice")
95 #define TTS_CONFIG                      tzplatform_mkpath(tzplatform_getid("TZ_USER_HOME"), "/share/.voice/tts-config.xml")
96 #define TTS_DEFAULT_CONFIG              tzplatform_mkpath(tzplatform_getid("TZ_SYS_RO_SHARE"), "/voice/tts/1.0/tts-config.xml")
97
98 #define TTS_DEFAULT_ENGINE              tzplatform_mkpath(tzplatform_getid("TZ_SYS_RO_SHARE"), "/voice/tts/1.0/engine")
99 #define TTS_DEFAULT_ENGINE_INFO         tzplatform_mkpath(tzplatform_getid("TZ_SYS_RO_SHARE"), "/voice/tts/1.0/engine-info")
100 #define TTS_DEFAULT_ENGINE_SETTING      tzplatform_mkpath(tzplatform_getid("TZ_SYS_RO_SHARE"), "/voice/tts/1.0/engine-setting")
101
102 #define TTS_HOME                        tzplatform_mkpath(tzplatform_getid("TZ_USER_HOME"), "/share/.voice/tts")
103 #define TTS_DOWNLOAD_BASE               tzplatform_mkpath(tzplatform_getid("TZ_USER_HOME"), "/share/.voice/tts/1.0")
104 #define TTS_DOWNLOAD_ENGINE_INFO        tzplatform_mkpath(tzplatform_getid("TZ_USER_HOME"), "share/.voice/tts/1.0/engine-info")
105
106 #define TTS_BASE_LANGUAGE               "en_US"
107
108 #define TTS_RETRY_COUNT                 7
109 #define TTS_RETRY_MIN_COUNT             2
110 #define TTS_CONNECTION_RETRY_COUNT      10
111 #define TTS_HELLO_RETRY_COUNT   40 // 500 ms * 40 = 20 sec
112
113 #define TTS_SPEED_MIN           1
114 #define TTS_SPEED_NORMAL        8
115 #define TTS_SPEED_MAX           15
116
117 #define TTS_PITCH_MIN           1
118 #define TTS_PITCH_NORMAL        8
119 #define TTS_PITCH_MAX           15
120
121 #define TTS_FEATURE_PATH        "tizen.org/feature/speech.synthesis"
122
123 #define TTS_ERROR_ALREADY_INITIALIZED   -999
124 #define TTS_CREDENTIAL_NEEDED_ALREADY_INITIALIZED       -1
125
126 #define TTS_ENGINE_APPID_LEN 256
127 #define TTS_INVALID_UID 0
128
129 /******************************************************************************************
130 * Defines for vconf key
131 *******************************************************************************************/
132
133 #define TTS_ACCESSIBILITY_KEY           VCONFKEY_SETAPPL_ACCESSIBILITY_TTS
134
135 #define TTS_LANGSET_KEY                 VCONFKEY_LANGSET
136
137 #define TTS_ENGINE_DB_DEFAULT       "db/voice/tts/engine/default"
138
139 #define TTS_PLAYING_STATUS_KEY "memory/tts/engine/voice-guide-playing"
140
141
142 /******************************************************************************************
143 * Defines for log tag
144 *******************************************************************************************/
145 #define TAG_TTSC "ttsc"
146 #define TAG_TTSCONFIG   "ttsconfig"
147
148
149 #ifdef __cplusplus
150 }
151 #endif
152
153 #endif  /* _TTS_DEFS_H__ */