#include <system_info.h>
#include <unistd.h>
#include <buxton2.h>
+#include <stdatomic.h>
#include <sound_manager.h>
#include <sound_manager_internal.h>
static Ecore_Timer* g_connect_timer = NULL;
static float g_volume_db = 0;
-static int g_feature_enabled = -1;
-
static pthread_mutex_t g_cynara_mutex = PTHREAD_MUTEX_INITIALIZER;
static cynara *p_cynara = NULL;
#define SND_MGR_DUCKING_DURATION 500
-static int __stt_get_feature_enabled()
+static bool is_stt_feature_enabled()
{
- if (0 == g_feature_enabled) {
+ static atomic_int stt_feature_enabled = -1;
+
+ if (0 == stt_feature_enabled) {
//LCOV_EXCL_START
SLOG(LOG_ERROR, TAG_STTC, "[ERROR] STT NOT supported");
- return STT_ERROR_NOT_SUPPORTED;
+ return false;
//LCOV_EXCL_STOP
- } else if (-1 == g_feature_enabled) {
+ } else if (-1 == stt_feature_enabled) {
bool stt_supported = false;
- bool mic_supported = false;
if (SYSTEM_INFO_ERROR_NONE != system_info_get_platform_bool(STT_FEATURE_PATH, &stt_supported)) {
//LCOV_EXCL_START
SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Fail to get feature value");
- return STT_ERROR_NOT_SUPPORTED;
+ return false;
//LCOV_EXCL_STOP
}
+ if (false == stt_supported) {
+ //LCOV_EXCL_START
+ SLOG(LOG_ERROR, TAG_STTC, "[ERROR] STT NOT supported");
+ stt_feature_enabled = 0;
+ return false;
+ //LCOV_EXCL_STOP
+ }
+
+ stt_feature_enabled = 1;
+ }
+
+ return true;
+}
+
+static bool is_mic_feature_enabled()
+{
+ static atomic_int mic_feature_enabled = -1;
+
+ if (0 == mic_feature_enabled) {
+ //LCOV_EXCL_START
+ SLOG(LOG_ERROR, TAG_STTC, "[ERROR] STT NOT supported");
+ return false;
+ //LCOV_EXCL_STOP
+ } else if (-1 == mic_feature_enabled) {
+ bool mic_supported = false;
+
if (SYSTEM_INFO_ERROR_NONE != system_info_get_platform_bool(STT_MIC_FEATURE_PATH, &mic_supported)) {
//LCOV_EXCL_START
SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Fail to get feature value");
- return STT_ERROR_NOT_SUPPORTED;
+ return false;
//LCOV_EXCL_STOP
}
- if (false == stt_supported || false == mic_supported) {
+ if (false == mic_supported) {
//LCOV_EXCL_START
SLOG(LOG_ERROR, TAG_STTC, "[ERROR] STT NOT supported");
- g_feature_enabled = 0;
- return STT_ERROR_NOT_SUPPORTED;
+ mic_feature_enabled = 0;
+ return false;
//LCOV_EXCL_STOP
}
- g_feature_enabled = 1;
+ mic_feature_enabled = 1;
+ }
+
+ return true;
+}
+
+static int __stt_get_feature_enabled()
+{
+ if (false == is_stt_feature_enabled() || false == is_mic_feature_enabled()) {
+ //LCOV_EXCL_START
+ SLOG(LOG_ERROR, TAG_STTC, "[ERROR] STT NOT supported");
+ return STT_ERROR_NOT_SUPPORTED;
+ //LCOV_EXCL_STOP
}
return STT_ERROR_NONE;
int stt_get_audio_format(stt_h stt, stt_audio_type_e* type, int* rate, int* num_of_channels)
{
stt_client_s* client = NULL;
- int temp = __stt_check_precondition(stt, &client);
- if (STT_ERROR_NONE != temp)
- return temp;
-
+ RETV_IF(false == is_stt_feature_enabled(), STT_ERROR_NOT_SUPPORTED);
+ RETV_IF(STT_ERROR_NONE != __stt_check_handle(stt, &client), STT_ERROR_INVALID_PARAMETER);
RETVM_IF(NULL == type || NULL == rate || NULL == num_of_channels, STT_ERROR_INVALID_PARAMETER, "[ERROR] Input parameter is NULL");
- RETVM_IF(client->current_state == STT_STATE_CREATED, STT_ERROR_INVALID_STATE, "[ERROR] Invalid State: Current state(%d) is CREATED", client->current_state);
+ RETVM_IF(client->current_state != STT_STATE_READY, STT_ERROR_INVALID_STATE, "[ERROR] Invalid State: Current state(%d) is not READY", client->current_state);
int ret = STT_ERROR_OPERATION_FAILED;
int count = 0;
int stt_start_audio_streaming(stt_h stt, const char* language, const char* type)
{
stt_client_s* client = NULL;
- int tmp = __stt_check_precondition_with_state(stt, &client, STT_STATE_READY);
- if (STT_ERROR_NONE != tmp)
- return tmp;
+ RETV_IF(false == is_stt_feature_enabled(), STT_ERROR_NOT_SUPPORTED);
+ RETV_IF(STT_ERROR_NONE != __stt_check_handle(stt, &client), STT_ERROR_INVALID_PARAMETER);
+ RETVM_IF(STT_STATE_READY != client->current_state, STT_ERROR_INVALID_STATE, "[ERROR] Current state(%d) is not READY", client->current_state);
RETVM_IF(STT_INTERNAL_STATE_NONE != client->internal_state, STT_ERROR_IN_PROGRESS_TO_RECORDING, "[ERROR] Invalid State : Internal state is NOT none : %d", client->current_state);
SLOG(LOG_INFO, TAG_STTC, "===== STT START AUDIO STREAMING");
int stt_send_audio_streaming(stt_h stt, const char* data, size_t data_size)
{
stt_client_s* client = NULL;
- int tmp = __stt_check_precondition_with_state(stt, &client, STT_STATE_RECORDING);
- if (STT_ERROR_NONE != tmp)
- return tmp;
+ RETV_IF(false == is_stt_feature_enabled(), STT_ERROR_NOT_SUPPORTED);
+ RETV_IF(STT_ERROR_NONE != __stt_check_handle(stt, &client), STT_ERROR_INVALID_PARAMETER);
+ RETVM_IF(STT_STATE_RECORDING != client->current_state, STT_ERROR_INVALID_STATE, "[ERROR] Current state(%d) is not RECORDING", client->current_state);
SLOG(LOG_INFO, TAG_STTC, "===== STT SEND AUDIO STREAMING");
int stt_stop_audio_streaming(stt_h stt)
{
stt_client_s* client = NULL;
- int temp = __stt_check_precondition_with_state(stt, &client, STT_STATE_RECORDING);
- if (STT_ERROR_NONE != temp)
- return temp;
+ RETV_IF(false == is_stt_feature_enabled(), STT_ERROR_NOT_SUPPORTED);
+ RETV_IF(STT_ERROR_NONE != __stt_check_handle(stt, &client), STT_ERROR_INVALID_PARAMETER);
+ RETVM_IF(STT_STATE_RECORDING != client->current_state, STT_ERROR_INVALID_STATE, "[ERROR] Current state(%d) is not RECORDING", client->current_state);
SLOG(LOG_INFO, TAG_STTC, "===== STT STOP AUDIO STREAMING");
/**
+* @brief Enumerations of audio type.
+* @since_tizen 8.0
+*/
+typedef enum {
+ STT_AUDIO_TYPE_RAW_S16 = 0, /**< Signed 16-bit audio sample */
+ STT_AUDIO_TYPE_RAW_U8, /**< Unsigned 8-bit audio sample */
+} stt_audio_type_e;
+
+/**
* @brief A structure of STT handle.
* @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
*/
* @privilege %http://tizen.org/privilege/recorder
* @remarks If the function succeeds, @a stt handle must be released with stt_destroy().
* @param[out] stt The STT handle
- * @return @c 0 on success,
+ * @return @c 0 on success,
* otherwise a negative error value
* @retval #STT_ERROR_NONE Successful
* @retval #STT_ERROR_OUT_OF_MEMORY Out of memory
* @privlevel public
* @privilege %http://tizen.org/privilege/recorder
* @param[in] stt The STT handle
- * @return @c 0 on success,
+ * @return @c 0 on success,
* otherwise a negative error value
* @retval #STT_ERROR_NONE Successful
* @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
* @param[in] stt The STT handle
* @param[in] callback The callback function to invoke
* @param[in] user_data The user data to be passed to the callback function
- * @return @c 0 on success,
+ * @return @c 0 on success,
* otherwise a negative error value
* @retval #STT_ERROR_NONE Success
* @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
* @remarks If the function is success, @a engine_id must be released using free().
* @param[in] stt The STT handle
* @param[out] engine_id Engine ID
- * @return @c 0 on success,
+ * @return @c 0 on success,
* otherwise a negative error value
* @retval #STT_ERROR_NONE Success
* @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
* @remarks A privilege (%http://tizen.org/privilege/appmanager.launch) is necessary since 3.0.
* @param[in] stt The STT handle
* @param[in] engine_id Engine ID
- * @return @c 0 on success,
+ * @return @c 0 on success,
* otherwise a negative error value
* @retval #STT_ERROR_NONE Success
* @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
* However, if the user wants to apply the 3rd party's engine, the credential may be necessary. In that case, please follow the policy provided by the corresponding engine.
* @param[in] stt The STT handle
* @param[in] credential The app credential
- * @return @c 0 on success,
+ * @return @c 0 on success,
* otherwise a negative error value
* @retval #STT_ERROR_NONE Success
* @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
* @param[in] stt The STT handle
* @param[in] key The field name of private data
* @param[in] data The data for set
- * @return @c 0 on success,
+ * @return @c 0 on success,
* otherwise a negative error value
* @retval #STT_ERROR_NONE Successful
* @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
* @param[in] stt The STT handle
* @param[in] key The field name of private data
* @param[out] data The data field of private data
- * @return @c 0 on success,
+ * @return @c 0 on success,
* otherwise a negative error value
* @retval #STT_ERROR_NONE Successful
* @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
* @privlevel public
* @privilege %http://tizen.org/privilege/recorder
* @param[in] stt The STT handle
- * @return @c 0 on success,
+ * @return @c 0 on success,
* otherwise a negative error value
* @retval #STT_ERROR_NONE Successful
* @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
* @privlevel public
* @privilege %http://tizen.org/privilege/recorder
* @param[in] stt The STT handle
- * @return @c 0 on success,
+ * @return @c 0 on success,
* otherwise a negative error value
* @retval #STT_ERROR_NONE Successful
* @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
* @param[in] stt The STT handle
* @param[in] callback The callback function to invoke
* @param[in] user_data The user data to be passed to the callback function
- * @return @c 0 on success,
+ * @return @c 0 on success,
* otherwise a negative error value
* @retval #STT_ERROR_NONE Successful
* @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
* If the function succeeds, @a language must be released using free() when it is no longer required.
* @param[in] stt The STT handle
* @param[out] language The language
- * @return @c 0 on success,
+ * @return @c 0 on success,
* otherwise a negative error value
* @retval #STT_ERROR_NONE Successful
* @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
* @privilege %http://tizen.org/privilege/recorder
* @param[in] stt The STT handle
* @param[out] state The current STT state
- * @return @c 0 on success,
+ * @return @c 0 on success,
* otherwise a negative error value
* @retval #STT_ERROR_NONE Successful
* @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
* If the function succeeds, @a err_msg must be released using free() when it is no longer required.
* @param[in] stt The STT handle
* @param[out] err_msg The current error message
- * @return @c 0 on success,
+ * @return @c 0 on success,
* otherwise a negative error value
* @retval #STT_ERROR_NONE Successful
* @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
* @param[in] type The type for recognition (e.g. #STT_RECOGNITION_TYPE_FREE, #STT_RECOGNITION_TYPE_FREE_PARTIAL)
* @param[out] support The result status @c true = supported,
* @c false = not supported
- * @return @c 0 on success,
+ * @return @c 0 on success,
* otherwise a negative error value
* @retval #STT_ERROR_NONE Successful
* @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
* @privilege %http://tizen.org/privilege/recorder
* @param[in] stt The STT handle
* @param[in] type The option type
- * @return @c 0 on success,
+ * @return @c 0 on success,
* otherwise a negative error value
* @retval #STT_ERROR_NONE Successful
* @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
* @remarks Sound file type should be wav type.
* @param[in] stt The STT handle
* @param[in] filename The sound file path
- * @return @c 0 on success,
+ * @return @c 0 on success,
* otherwise a negative error value
* @retval #STT_ERROR_NONE Successful
* @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
* @privlevel public
* @privilege %http://tizen.org/privilege/recorder
* @param[in] stt The STT handle
- * @return @c 0 on success,
+ * @return @c 0 on success,
* otherwise a negative error value
* @retval #STT_ERROR_NONE Successful
* @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
* @remarks Sound file type should be wav type.
* @param[in] stt The STT handle
* @param[in] filename The sound file path
- * @return @c 0 on success,
+ * @return @c 0 on success,
* otherwise a negative error value
* @retval #STT_ERROR_NONE Successful
* @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
* @privlevel public
* @privilege %http://tizen.org/privilege/recorder
* @param[in] stt The STT handle
- * @return @c 0 on success,
+ * @return @c 0 on success,
* otherwise a negative error value
* @retval #STT_ERROR_NONE Successful
* @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
* @param[in] stt The STT handle
* @param[in] language The language selected from stt_foreach_supported_languages()
* @param[in] type The type for recognition (e.g. #STT_RECOGNITION_TYPE_FREE, #STT_RECOGNITION_TYPE_FREE_PARTIAL)
- * @return @c 0 on success,
+ * @return @c 0 on success,
* otherwise a negative error value
* @retval #STT_ERROR_NONE Successful
* @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
* @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
* @privlevel public
* @privilege %http://tizen.org/privilege/recorder
+ * @remarks This function can only stop recording started by stt_start().
* @param[in] stt The STT handle
- * @return @c 0 on success,
+ * @return @c 0 on success,
* otherwise a negative error value
* @retval #STT_ERROR_NONE Successful
* @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
* @post It will invoke stt_state_changed_cb(), if you register a callback with stt_state_changed_cb().
* If this function succeeds, the STT state will be #STT_STATE_PROCESSING.
* If you call this function again before state changes, you will receive #STT_ERROR_IN_PROGRESS_TO_PROCESSING.
+ * If you call this function after starting recording by stt_start_audio_streaming(), you will receive #STT_ERROR_OPERATION_FAILED.
* After processing of engine, stt_result_cb() is called.
* @see stt_start()
* @see stt_cancel()
* @remarks This function cancels recording and engine cancels recognition processing.
* After successful cancel, stt_state_changed_cb() is called otherwise if error is occurred, stt_error_cb() is called.
* @param[in] stt The STT handle
- * @return @c 0 on success,
+ * @return @c 0 on success,
* otherwise a negative error value
* @retval #STT_ERROR_NONE Successful
* @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
* @privilege %http://tizen.org/privilege/recorder
* @param[in] stt The STT handle
* @param[out] volume Recording volume
- * @return @c 0 on success,
+ * @return @c 0 on success,
* otherwise a negative error value
* @retval #STT_ERROR_NONE Successful
* @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
* @param[in] stt The STT handle
* @param[in] callback The callback function to invoke
* @param[in] user_data The user data to be passed to the callback function
- * @return @c 0 on success,
+ * @return @c 0 on success,
* otherwise a negative error value
* @retval #STT_ERROR_NONE Successful
* @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
* @param[in] stt The STT handle
* @param[in] callback The callback function to register
* @param[in] user_data The user data to be passed to the callback function
- * @return @c 0 on success,
+ * @return @c 0 on success,
* otherwise a negative error value
* @retval #STT_ERROR_NONE Successful
* @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
* @privlevel public
* @privilege %http://tizen.org/privilege/recorder
* @param[in] stt The STT handle
- * @return @c 0 on success,
+ * @return @c 0 on success,
* otherwise a negative error value
* @retval #STT_ERROR_NONE Successful
* @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
* @param[in] stt The STT handle
* @param[in] callback The callback function to register
* @param[in] user_data The user data to be passed to the callback function
- * @return @c 0 on success,
+ * @return @c 0 on success,
* otherwise a negative error value
* @retval #STT_ERROR_NONE Successful
* @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
* @privlevel public
* @privilege %http://tizen.org/privilege/recorder
* @param[in] stt The STT handle
- * @return @c 0 on success,
+ * @return @c 0 on success,
* otherwise a negative error value
* @retval #STT_ERROR_NONE Successful
* @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
* @param[in] stt The STT handle
* @param[in] callback The callback function to register
* @param[in] user_data The user data to be passed to the callback function
- * @return @c 0 on success,
+ * @return @c 0 on success,
* otherwise a negative error value
* @retval #STT_ERROR_NONE Successful
* @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
* @privlevel public
* @privilege %http://tizen.org/privilege/recorder
* @param[in] stt The STT handle
- * @return @c 0 on success,
+ * @return @c 0 on success,
* otherwise a negative error value
* @retval #STT_ERROR_NONE Successful
* @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
* @param[in] stt The STT handle
* @param[in] callback The callback function to register
* @param[in] user_data The user data to be passed to the callback function
- * @return @c 0 on success,
+ * @return @c 0 on success,
* otherwise a negative error value
* @retval #STT_ERROR_NONE Successful
* @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
* @privlevel public
* @privilege %http://tizen.org/privilege/recorder
* @param[in] stt The STT handle
- * @return @c 0 on success,
+ * @return @c 0 on success,
* otherwise a negative error value
* @retval #STT_ERROR_NONE Successful
* @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
* @param[in] stt The STT handle
* @param[in] callback The callback function to register
* @param[in] user_data The user data to be passed to the callback function
- * @return @c 0 on success,
+ * @return @c 0 on success,
* otherwise a negative error value
* @retval #STT_ERROR_NONE Successful
* @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
* @brief Unsets the callback function.
* @since_tizen @if MOBILE 3.0 @elseif WEARABLE 2.3.2 @endif
* @param[in] stt The STT handle
- * @return @c 0 on success,
+ * @return @c 0 on success,
* otherwise a negative error value
* @retval #STT_ERROR_NONE Successful
* @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
int stt_unset_speech_status_cb(stt_h stt);
+/**
+ * @brief Starts audio streaming and recognition asynchronously.
+ * @since_tizen 8.0
+ * @remarks This function starts audio streaming in the STT service.
+ * This work continues until stt_stop_audio_streaming(), stt_cancel() or silence detected by engine.
+ * @param[in] stt The STT handle
+ * @param[in] language The language selected from stt_foreach_supported_languages() (e.g. #NULL(Automatic), 'en_US')
+ * @param[in] type The type for recognition (e.g. #STT_RECOGNITION_TYPE_FREE, #STT_RECOGNITION_TYPE_FREE_PARTIAL)
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ * @retval #STT_ERROR_NONE Successful
+ * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
+ * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #STT_ERROR_INVALID_STATE Invalid state
+ * @retval #STT_ERROR_OPERATION_FAILED Operation failure
+ * @retval #STT_ERROR_RECORDER_BUSY Recorder busy
+ * @retval #STT_ERROR_INVALID_LANGUAGE Invalid language
+ * @retval #STT_ERROR_IN_PROGRESS_TO_RECORDING Progress to recording is not finished
+ * @pre The state should be #STT_STATE_READY.
+ * @post It will invoke stt_state_changed_cb(), if you register a callback with stt_state_changed_cb().
+ * If this function succeeds, the STT state will be #STT_STATE_RECORDING.
+ * If you call this function again before state changes, you will receive #STT_ERROR_IN_PROGRESS_TO_RECORDING.
+ * @see stt_stop_audio_streaming()
+ * @see stt_send_audio_streaming()
+ * @see stt_cancel()
+ * @see stt_state_changed_cb()
+*/
+int stt_start_audio_streaming(stt_h stt, const char* language, const char* type);
+
+
+/**
+ * @brief Sends audio data to STT engine.
+ * @since_tizen 8.0
+ * @remarks The audio format of @a data should satisfy the audio format from stt_get_audio_format().
+ * @param[in] stt The STT handle
+ * @param[in] data The raw PCM data
+ * @param[in] data_size The number of bytes of @a data
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ * @retval #STT_ERROR_NONE Successful
+ * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
+ * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #STT_ERROR_INVALID_STATE Invalid state
+ * @retval #STT_ERROR_OPERATION_FAILED Operation failure
+ * @retval #STT_ERROR_IN_PROGRESS_TO_READY Progress to ready is not finished
+ * @retval #STT_ERROR_IN_PROGRESS_TO_RECORDING Progress to recording is not finished
+ * @pre The state should be #STT_STATE_RECORDING.
+ * @post If you call this function after starting recording by stt_start(), you will receive #STT_ERROR_OPERATION_FAILED.
+ * @see stt_start_audio_streaming()
+ * @see stt_stop_audio_streaming()
+ * @see stt_cancel()
+ * @see stt_get_audio_format()
+*/
+int stt_send_audio_streaming(stt_h stt, const char* data, size_t data_size);
+
+
+/**
+ * @brief Finishes the audio streaming and starts recognition processing in engine asynchronously.
+ * @since_tizen 8.0
+ * @remarks This function can only stop recording started by stt_start_audio_streaming().
+ * @param[in] stt The STT handle
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ * @retval #STT_ERROR_NONE Successful
+ * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
+ * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #STT_ERROR_INVALID_STATE Invalid state
+ * @retval #STT_ERROR_OPERATION_FAILED Operation failure
+ * @retval #STT_ERROR_IN_PROGRESS_TO_READY Progress to ready is not finished
+ * @retval #STT_ERROR_IN_PROGRESS_TO_PROCESSING Progress to processing is not finished
+ * @pre The state should be #STT_STATE_RECORDING.
+ * @post It will invoke stt_state_changed_cb(), if you register a callback with stt_state_changed_cb().
+ * If this function succeeds, the STT state will be #STT_STATE_PROCESSING.
+ * If you call this function again before state changes, you will receive #STT_ERROR_IN_PROGRESS_TO_PROCESSING.
+ * If you call this function after starting recording by stt_start(), you will receive #STT_ERROR_OPERATION_FAILED.
+ * After processing of engine, stt_result_cb() is called.
+ * @see stt_start_audio_streaming()
+ * @see stt_cancel()
+ * @see stt_state_changed_cb()
+*/
+int stt_stop_audio_streaming(stt_h stt);
+
+
+/**
+ * @brief Gets the recognizable audio format information.
+ * @since_tizen 8.0
+ * @param[in] stt The STT handle
+ * @param[out] type The audio type
+ * @param[out] rate The sample rates
+ * @param[out] num_of_channels The number of channels
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ * @retval #STT_ERROR_NONE Successful
+ * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
+ * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #STT_ERROR_INVALID_STATE Invalid state
+ * @retval #STT_ERROR_OPERATION_FAILED Operation failure
+ * @pre The state should be #STT_STATE_READY.
+ * @see stt_send_audio_streaming()
+*/
+int stt_get_audio_format(stt_h stt, stt_audio_type_e* type, int* rate, int* num_of_channels);
+
+
#ifdef __cplusplus
}
#endif