2 * Copyright (c) 2011-2016 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.
17 #ifndef __STT_INTERNAL_H__
18 #define __STT_INTERNAL_H__
24 * @file stt_internal.h
32 #define STT_SPEECH_STATUS_BEGINNING_POINT_DETECTED 0
35 * @brief Called when user speaking is detected.
37 * @param[in] stt The STT handle
38 * @param[in] status The speech status
39 * @param[in] user_data The user data passed from the callback registration function
41 * @pre An application registers callback function using stt_set_speech_status_cb().
43 * @see stt_set_speech_status_cb()
44 * @see stt_unset_speech_status_cb()
46 typedef void (*stt_speech_status_cb)(stt_h stt, int status, void *user_data);
50 * @brief Registers a callback function to detect the speech status is changed.
52 * @privilege %http://tizen.org/privilege/recorder
54 * @param[in] stt The STT handle
55 * @param[in] callback The callback function to register
56 * @param[in] user_data The user data to be passed to the callback function
58 * @return 0 on success, otherwise a negative error value
59 * @retval #STT_ERROR_NONE Successful
60 * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
61 * @retval #STT_ERROR_INVALID_STATE Invalid state
62 * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
63 * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
65 * @pre The state should be #STT_STATE_CREATED.
67 * @see stt_speech_status_cb()
68 * @see stt_unset_speech_status_cb()
70 int stt_set_speech_status_cb(stt_h stt, stt_speech_status_cb callback, void* user_data);
73 * @brief Unregisters the callback function.
75 * @privilege %http://tizen.org/privilege/recorder
77 * @param[in] stt The STT handle
79 * @return 0 on success, otherwise a negative error value
80 * @retval #STT_ERROR_NONE Successful
81 * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
82 * @retval #STT_ERROR_INVALID_STATE Invalid state
83 * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
84 * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
86 * @pre The state should be #STT_STATE_CREATED.
88 * @see stt_set_speech_status_cb()
90 int stt_unset_speech_status_cb(stt_h stt);
93 * @brief Sets server STT.
94 * @details Using this API, the application can set server STT with a @a key as a @a user_data
95 * The key is a private data to set STT server.
96 * There are 3 types of keys; "server", "rampcode" and "epd".
97 * "server": STT server address
98 * "rampcode": ASR ramp code
99 * "epd": A threshold for end-point detection
101 * The application can input the @a user_data corresponding to the @a key.
102 * "server": "qa", "sbx"
103 * "rampcode": "dash_dict", "dash_da"
104 * "epd": "100", "750", etc
106 * If the application sets those keys, it will be able to use corresponding STT engines and options.
109 * @privilege %http://tizen.org/privilege/recorder
111 * @param[in] stt The STT handle
112 * @param[in] key The key
113 * @param[in] user_data The user data corresponding to the key
115 * @return 0 on success, otherwise a negative error value
116 * @retval #STT_ERROR_NONE Successful
117 * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
118 * @retval #STT_ERROR_INVALID_STATE Invalid state
119 * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
120 * @retval #STT_ERROR_OUT_OF_MEMORY STT Out of memory
121 * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
123 * @pre The state should be #STT_STATE_READY.
125 int stt_set_server_stt(stt_h stt, const char* key, char* user_data);
135 #endif /* __STT_INTERNAL_H__ */