6636bd6ef16f8166931663435f30b47ccd3e3761
[platform/core/uifw/tts.git] / doc / uix_tts_doc.h
1 /*
2  * Copyright (c) 2011-2014 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  * Licensed under the Apache License, Version 2.0 (the License);
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an AS IS BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License. 
15  */
16
17
18 #ifndef __TIZEN_UIX_TTS_DOC_H__
19 #define __TIZEN_UIX_TTS_DOC_H__
20
21 /**
22  * @defgroup CAPI_UIX_TTS_MODULE TTS
23  * @ingroup CAPI_UIX_FRAMEWORK
24  * @brief The @ref CAPI_UIX_TTS_MODULE API provides functions for synthesizing voice from text and playing synthesized sound data.
25  * 
26  * @section CAPI_UIX_TTS_MODULE_HEADER Required Header
27  *   \#include <tts.h>
28  * 
29  * @section CAPI_UIX_TTS_MODULE_OVERVIEW Overview
30  * A main function of Text-To-Speech(below TTS) API reads sound data transformed by the engine using input texts.
31  * Applications can add input-text to queue for reading continuously and control a player that can play, pause, and stop sound data synthesized from text.
32  *
33  * To use of TTS, use the following steps:<br>
34  * 1. Create a handle <br>
35  * 2. Register callback functions for notifications <br> 
36  * 3. Prepare tts-daemon asynchronously <br>
37  * 4. Add text to queue for speech <br>
38  * 5. Start synthesizing voice from text and play synthesized sound data <br>
39  * 6. Pause the player <br>
40  * 7. Resume the player <br>
41  * 8. Stop the player <br>
42  * 9. Destroy a handle <br>
43  * 
44  * The TTS API also notifies you (by callback mechanism) when the state of TTS is changed, 
45  * utterance is started and completed, default voice is changed or an error occured.
46  * An application should register callback functions: tts_state_changed_cb(), tts_utterance_started_cb(), 
47  * tts_utterance_completed_cb(), tts_default_voice_changed_cb(), tts_error_cb().
48  *
49  * @section CAPI_UIX_TTS_MODULE_STATE_DIAGRAM State Diagram
50  * The following diagram shows the life cycle and the states of the TTS.
51  *
52  * @image html capi_uix_tts_state_diagram.png "State diagram"
53  *
54  * @section CAPI_UIX_TTS_MODULE_STATE_TRANSITIONS State Transitions
55  *
56  * <table>
57  * <tr>
58  * <th>FUNCTION</th>
59  * <th>PRE-STATE</th>
60  * <th>POST-STATE</th>
61  * <th>SYNC TYPE</th>
62  * </tr>
63  * <tr>
64  * <td>tts_prepare()</td>
65  * <td>Created</td>
66  * <td>Ready</td>
67  * <td>ASYNC</td>
68  * </tr>
69  * <tr>
70  * <td>tts_play()</td>
71  * <td>Ready, Paused</td>
72  * <td>Playing</td>
73  * <td>SYNC</td>
74  * </tr>
75  * <tr>
76  * <td>tts_stop()</td>
77  * <td>Ready, Playing, Paused</td>
78  * <td>Ready</td>
79  * <td>SYNC</td>
80  * </tr>
81  * <tr>
82  * <td>tts_pause()</td>
83  * <td>Playing</td>
84  * <td>Paused</td>
85  * <td>SYNC</td>
86  * </tr>
87  * </table>
88  *
89  * @section CAPI_UIX_TTS_MODULE_STATE_DEPENDENT_FUNCTION_CALLS State Dependent Function Calls
90  * The following table shows state-dependent function calls.
91  * It is forbidden to call functions listed below in wrong states.
92  * Violation of this rule may result in an unpredictable behavior.
93  * 
94  * <table>
95  * <tr>
96  * <th>FUNCTION</th>
97  * <th>VALID STATES</th>
98  * <th>DESCRIPTION</th>
99  * </tr>
100  * <tr>
101  * <td>tts_create()</td>
102  * <td>None</td>
103  * <td>All functions must be called after tts_create()</td>
104  * </tr>
105  * <tr>
106  * <td>tts_destroy()</td>
107  * <td>Created, Ready, Playing, Paused</td>
108  * <td></td>
109  * </tr>
110  * <tr>
111  * <td>tts_set_mode()</td>
112  * <td>Created</td>
113  * <td>The application should set mode to use TTS for screen reader or notification like driving mode.</td>
114  * </tr>
115  * <tr>
116  * <td>tts_get_mode()</td>
117  * <td>Created</td>
118  * <td></td>
119  * </tr>
120  * <tr>
121  * <td>tts_prepare()</td>
122  * <td>Created</td>
123  * <td>This function works asynchronously. If daemon fork is failed, application gets the error callback.</td>
124  * </tr>
125  * <tr>
126  * <td>tts_unprepare()</td>
127  * <td>Ready</td>
128  * <td></td>
129  * </tr>
130  * <tr>
131  * <td>tts_foreach_supported_voices()</td>
132  * <td>Created, Ready, Playing, Paused</td>
133  * <td></td>
134  * </tr>
135  * <tr>
136  * <td>tts_get_default_voice()</td>
137  * <td>Created, Ready, Playing, Paused</td>
138  * <td></td>
139  * </tr>
140  * <tr>
141  * <td>tts_get_state()</td>
142  * <td>Created, Ready, Playing, Paused</td>
143  * <td></td>
144  * </tr>
145  * <tr>
146  * <td>tts_get_max_text_size()</td>
147  * <td>Ready</td>
148  * <td></td>
149  * </tr>
150  * <tr>
151  * <td>tts_get_speed_range()</td>
152  * <td>Ready</td>
153  * <td></td>
154  * </tr>
155  * <tr>
156  * <td>tts_add_text()</td>
157  * <td>Ready, Playing, Paused</td>
158  * <td></td>
159  * </tr>
160  * <tr>
161  * <td>tts_play()</td>
162  * <td>Ready, Paused</td>
163  * <td></td>
164  * </tr>
165  * <tr>
166  * <td>tts_stop()</td>
167  * <td>Ready, Playing, Paused</td>
168  * <td></td>
169  * </tr>
170  * <tr>
171  * <td>tts_pause()</td>
172  * <td>Playing</td>
173  * <td></td>
174  * </tr>
175  * <tr>
176  * <td>
177  * tts_set_state_changed_cb()<br>
178  * tts_unset_state_changed_cb()<br>
179  * tts_set_utterance_started_cb()<br>
180  * tts_unset_utterance_started_cb()<br>
181  * tts_set_utterance_completed_cb()<br>
182  * tts_unset_utterance_completed_cb()<br>
183  * tts_set_default_voice_changed_cb()<br>
184  * tts_unset_default_voice_changed_cb()<br>
185  * tts_set_error_cb()<br>
186  * tts_unset_error_cb()</td>
187  * <td>Created</td>
188  * <td> All callback function should be registered in Created state </td>
189  * </tr>
190  * </table>
191  * 
192  * @section CAPI_UIX_TTS_MODULE_FEATURE Related Features
193  * This API is related with the following features:<br>
194  *  - http://tizen.org/feature/speech.synthesis<br>
195  *
196  * It is recommended to design feature related codes in your application for reliability.<br>
197  * You can check if a device supports the related features for this API by using @ref CAPI_SYSTEM_SYSTEM_INFO_MODULE, thereby controlling the procedure of your application.<br>
198  * To ensure your application is only running on the device with specific features, please define the features in your manifest file using the manifest editor in the SDK.<br>
199  * More details on featuring your application can be found from <a href="../org.tizen.mobile.native.appprogramming/html/ide_sdk_tools/feature_element.htm"><b>Feature Element</b>.</a>
200  *
201  */
202
203 #endif /* __TIZEN_UIX_TTS_DOC_H__ */
204