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__
23 * @file stt_internal.h
31 #define STT_SPEECH_STATUS_BEGINNING_POINT_DETECTED 0
34 * @brief Called when user speaking is detected.
36 * @param[in] stt The STT handle
37 * @param[in] status The speech status
38 * @param[in] user_data The user data passed from the callback registration function
40 * @pre An application registers callback function using stt_set_speech_status_cb().
42 * @see stt_set_speech_status_cb()
43 * @see stt_unset_speech_status_cb()
45 typedef void (*stt_speech_status_cb)(stt_h stt, int status, void *user_data);
49 * @brief Registers a callback function to detect the speech status is changed.
51 * @privilege %http://tizen.org/privilege/recorder
53 * @param[in] stt The STT handle
54 * @param[in] callback The callback function to register
55 * @param[in] user_data The user data to be passed to the callback function
57 * @return 0 on success, otherwise a negative error value
58 * @retval #STT_ERROR_NONE Successful
59 * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
60 * @retval #STT_ERROR_INVALID_STATE Invalid state
61 * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
62 * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
64 * @pre The state should be #STT_STATE_CREATED.
66 * @see stt_speech_status_cb()
67 * @see stt_unset_speech_status_cb()
69 int stt_set_speech_status_cb(stt_h stt, stt_speech_status_cb callback, void* user_data);
72 * @brief Unregisters the callback function.
74 * @privilege %http://tizen.org/privilege/recorder
76 * @param[in] stt The STT handle
78 * @return 0 on success, otherwise a negative error value
79 * @retval #STT_ERROR_NONE Successful
80 * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
81 * @retval #STT_ERROR_INVALID_STATE Invalid state
82 * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
83 * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
85 * @pre The state should be #STT_STATE_CREATED.
87 * @see stt_set_speech_status_cb()
89 int stt_unset_speech_status_cb(stt_h stt);
99 #endif /* __STT_INTERNAL_H__ */