a55cb9a6a48a9439554da271864b4d8dd499d9e9
[platform/core/uifw/stt.git] / doc / uix_stt_doc.h
1 /*
2  * Copyright (c) 2011-2016 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_STT_DOC_H__
19 #define __TIZEN_UIX_STT_DOC_H__
20
21 /**
22  * @defgroup CAPI_UIX_STT_MODULE STT
23  * @ingroup CAPI_UIX_FRAMEWORK
24  * @brief The @ref CAPI_UIX_STT_MODULE API provides functions to recognize the speech.
25  *
26  * @section CAPI_UIX_STT_MODULE_HEADER Required Header
27  *   \#include <stt.h>
28  *
29  * @section CAPI_UIX_STT_MODULE_OVERVIEW Overview
30  * A main function of Speech-To-Text (below STT) API recognizes sound data recorded by users.
31  * After choosing a language, applications will start recording and recognizing.
32  * After recording, the applications will receive the recognized result.
33  *
34  * To use of STT, use the following steps:<br>
35  * 1. Create a handle <br>
36  * 2. Register callback functions for notifications <br>
37  * 3. Prepare stt-daemon asynchronously <br>
38  * 4. Start recording for recognition <br>
39  * 5. Stop recording <br>
40  * 6. Get result after processing <br>
41  * 7. Destroy a handle <br>
42  *
43  * The STT has a client-server for the service of multi-applications.
44  * The STT daemon as a server always works in the background for the STT service.
45  * If the daemon is not working, client library will invoke it and client will communicate with it.
46  * The daemon has engines and the recorder so client does not have the recorder itself.
47  * Only the client request commands to the daemon for the service.
48  *
49  * @section CAPI_STT_MODULE_STATE_DIAGRAM State Diagram
50  * The following diagram shows the life cycle and the states of the STT.
51  *
52  * @image html capi_uix_stt_state_diagram.png "State diagram"
53  *
54  * @section CAPI_STT_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>stt_prepare()</td>
65  * <td>Created</td>
66  * <td>Ready</td>
67  * <td>ASYNC</td>
68  * </tr>
69  * <tr>
70  * <td>stt_start()</td>
71  * <td>Ready</td>
72  * <td>Recording</td>
73  * <td>ASYNC</td>
74  * </tr>
75  * <tr>
76  * <td>stt_stop()</td>
77  * <td>Recording</td>
78  * <td>Processing</td>
79  * <td>ASYNC</td>
80  * </tr>
81  * </tr>
82  * <tr>
83  * <td>stt_cancel()</td>
84  * <td>Recording or Processing</td>
85  * <td>Ready</td>
86  * <td>ASYNC</td>
87  * </tr>
88  * </table>
89  *
90  * @section CAPI_STT_MODULE_STATE_DEPENDENT_FUNCTION_FUNCTION_CALLS State Dependent Function Calls
91  * The following table shows state-dependent function calls. 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>stt_create()</td>
102  * <td>None</td>
103  * <td>All functions must be called after stt_create().</td>
104  * </tr>
105  * <tr>
106  * <td>stt_destroy()</td>
107  * <td>Created, Ready, Recording, Processing</td>
108  * <td></td>
109  * </tr>
110  * <tr>
111  * <td>stt_prepare()</td>
112  * <td>Created</td>
113  * <td>This function works asynchronously. If daemon fork is failed, application gets the error callback.</td>
114  * </tr>
115  * <tr>
116  * <td>stt_unprepare()</td>
117  * <td>Ready</td>
118  * <td></td>
119  * </tr>
120  * <tr>
121  * <td>stt_foreach_supported_engines()</td>
122  * <td>Created</td>
123  * <td></td>
124  * </tr>
125  * <tr>
126  * <td>stt_get_engine()</td>
127  * <td>Created</td>
128  * <td></td>
129  * </tr>
130  * <tr>
131  * <td>stt_set_engine()</td>
132  * <td>Created</td>
133  * <td></td>
134  * </tr>
135  * <tr>
136  * <td>stt_foreach_supported_languages()</td>
137  * <td>Created, Ready, Recording, Processing</td>
138  * <td></td>
139  * </tr>
140  * <tr>
141  * <td>stt_get_default_language()</td>
142  * <td>Created, Ready, Recording, Processing</td>
143  * <td></td>
144  * </tr>
145  * <tr>
146  * <td>stt_get_state()</td>
147  * <td>Created, Ready, Recording, Processing</td>
148  * <td></td>
149  * </tr>
150  * <tr>
151  * <td>stt_is_recognition_type_supported()</td>
152  * <td>Ready</td>
153  * <td></td>
154  * </tr>
155  * <tr>
156  * <td>stt_set_silence_detection()</td>
157  * <td>Ready</td>
158  * <td></td>
159  * </tr>
160  * <tr>
161  * <td>stt_set_start_sound()<br>stt_unset_start_sound()<br>stt_set_stop_sound()<br>stt_unset_stop_sound()</td>
162  * <td>Ready</td>
163  * <td></td>
164  * </tr>
165  * <tr>
166  * <td>stt_start()</td>
167  * <td>Ready</td>
168  * <td></td>
169  * </tr>
170  * <tr>
171  * <td>stt_stop()</td>
172  * <td>Recording</td>
173  * <td></td>
174  * </tr>
175  * <tr>
176  * <td>stt_cancel()</td>
177  * <td>Recording, Processing</td>
178  * <td></td>
179  * </tr>
180  * <tr>
181  * <td>stt_get_recording_volume()</td>
182  * <td>Recording</td>
183  * <td></td>
184  * </tr>
185  * <tr>
186  * <td>stt_foreach_detailed_result()</td>
187  * <td>Processing</td>
188  * <td>This must be called in stt_recognition_result_cb()</td>
189  * </tr>
190  * <tr>
191  * <td>stt_set_recognition_result_cb()<br>stt_unset_recognition_result_cb()<br>
192  * stt_set_state_changed_cb()<br>stt_unset_state_changed_cb()<br>stt_set_error_cb()<br>stt_unset_error_cb()<br>
193  * stt_set_default_language_changed_cb()<br>stt_unset_default_language_changed_cb()
194  * </td>
195  * <td>Created</td>
196  * <td>All callback function should be registered / unregistered in Created state</td>
197  * </tr>
198  * </table>
199  *
200  * @section CAPI_UIX_STT_MODULE_FEATURE Related Features
201  * This API is related with the following features:<br>
202  *  - http://tizen.org/feature/speech.recognition<br>
203  *  - http://tizen.org/feature/microphone<br>
204  *
205  * It is recommended to design feature related codes in your application for reliability.<br>
206  * 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>
207  * 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>
208  * 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>
209  *
210  */
211
212 #endif /* __TIZEN_UIX_STT_DOC_H__ */
213