2 * Copyright (c) 2011-2014 Samsung Electronics Co., Ltd All Rights Reserved
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
18 #ifndef __TIZEN_UIX_TTS_DOC_H__
19 #define __TIZEN_UIX_TTS_DOC_H__
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.
26 * @section CAPI_UIX_TTS_MODULE_HEADER Required Header
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.
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>
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().
49 * @section CAPI_UIX_TTS_MODULE_STATE_DIAGRAM State Diagram
50 * The following diagram shows the life cycle and the states of the TTS.
52 * @image html capi_uix_tts_state_diagram.png "State diagram"
54 * @section CAPI_UIX_TTS_MODULE_STATE_TRANSITIONS State Transitions
64 * <td>tts_prepare()</td>
71 * <td>Ready, Paused</td>
77 * <td>Ready, Playing, Paused</td>
82 * <td>tts_pause()</td>
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.
97 * <th>VALID STATES</th>
98 * <th>DESCRIPTION</th>
101 * <td>tts_create()</td>
103 * <td>All functions must be called after tts_create()</td>
106 * <td>tts_destroy()</td>
107 * <td>Created, Ready, Playing, Paused</td>
111 * <td>tts_set_mode()</td>
113 * <td>The application should set mode to use TTS for screen reader or notification like driving mode.</td>
116 * <td>tts_get_mode()</td>
121 * <td>tts_prepare()</td>
123 * <td>This function works asynchronously. If daemon fork is failed, application gets the error callback.</td>
126 * <td>tts_unprepare()</td>
131 * <td>tts_foreach_supported_voices()</td>
132 * <td>Created, Ready, Playing, Paused</td>
136 * <td>tts_get_default_voice()</td>
137 * <td>Created, Ready, Playing, Paused</td>
141 * <td>tts_get_state()</td>
142 * <td>Created, Ready, Playing, Paused</td>
146 * <td>tts_get_max_text_size()</td>
151 * <td>tts_get_speed_range()</td>
156 * <td>tts_add_text()</td>
157 * <td>Ready, Playing, Paused</td>
161 * <td>tts_play()</td>
162 * <td>Ready, Paused</td>
166 * <td>tts_stop()</td>
167 * <td>Ready, Playing, Paused</td>
171 * <td>tts_pause()</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>
188 * <td> All callback function should be registered in Created state </td>
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>
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="https://developer.tizen.org/development/tools/native-tools/manifest-text-editor#feature"><b>Feature Element</b>.</a>
203 #endif /* __TIZEN_UIX_TTS_DOC_H__ */