/**
* @brief Enumerations of error codes.
-* @since_tizen 5.0
+* @since_tizen 4.0
*/
typedef enum {
VCE_ERROR_NONE = TIZEN_ERROR_NONE, /**< Successful */
/**
* @brief Enumerations of audio type.
-* @since_tizen 5.0
+* @since_tizen 4.0
*/
typedef enum {
VCE_AUDIO_TYPE_PCM_S16_LE = 0, /**< Signed 16bit audio type, Little endian */
/**
* @brief Enumerations of callback event.
-* @since_tizen 5.0
+* @since_tizen 4.0
*/
typedef enum {
VCE_RESULT_EVENT_SUCCESS = 0, /**< Event when the recognition full result is ready */
/**
* @brief Enumerations of command type.
-* @since_tizen 5.0
+* @since_tizen 4.0
*/
typedef enum {
VCE_COMMAND_FORMAT_FIXED = 0, /**< Fixed command */
/**
* @brief Enumerations of speech detect.
-* @since_tizen 5.0
+* @since_tizen 4.0
*/
typedef enum {
VCE_SPEECH_DETECT_NONE = 0, /**< No event */
/**
* @brief Enumerations of ASR result events.
-* @since_tizen 5.0
+* @since_tizen 4.0
*/
typedef enum {
VCE_ASR_RESULT_EVENT_FINAL_RESULT = 0, /**< Event when the ASR result is last data or ASR result is only one result */
} vce_asr_result_event_e;
/**
- * @brief Enumerations of audio channels
- * @since_tizen 5.0
+ * @brief Enumerations of audio channels.
+ * @since_tizen 4.0
*/
typedef enum {
VCE_AUDIO_CHANNEL_MONO = 0, /**< 1 channel, mono */
} vce_audio_channel_e;
/**
- * @brief Enumeration for TTS feedback events
- * @since_tizen 5.0
+ * @brief Enumeration for TTS feedback events.
+ * @since_tizen 4.0
*/
typedef enum {
VCE_FEEDBACK_EVENT_FAIL = -1, /**< Failed */
/**
* @brief A structure of handle for VC command.
-* @since_tizen 5.0
+* @since_tizen 4.0
*/
typedef struct vce_cmd_s* vce_cmd_h;
/**
* @brief Definition for foreground command type.
-* @since_tizen 5.0
+* @since_tizen 4.0
*/
#define VCE_COMMAND_TYPE_FOREGROUND 1
/**
* @brief Definition for background command type.
-* @since_tizen 5.0
+* @since_tizen 4.0
*/
#define VCE_COMMAND_TYPE_BACKGROUND 2
/**
* @brief Definition for widget command type.
-* @since_tizen 5.0
+* @since_tizen 4.0
*/
#define VCE_COMMAND_TYPE_WIDGET 3
/**
* @brief Definition for system command type.
-* @since_tizen 5.0
+* @since_tizen 4.0
*/
#define VCE_COMMAND_TYPE_SYSTEM 4
/**
* @brief Definition for system background command type.
-* @since_tizen 5.0
+* @since_tizen 4.0
*/
#define VCE_COMMAND_TYPE_SYSTEM_BACKGROUND 5
/**
* @brief Definitions for exclusive command type.
-* @since_tizen 5.0
+* @since_tizen 4.0
*/
#define VCE_COMMAND_TYPE_EXCLUSIVE 6
/**
* @brief Definition of bluetooth audio id.
-* @since_tizen 5.0
+* @since_tizen 4.0
*/
#define VCE_AUDIO_ID_BLUETOOTH "VC_AUDIO_ID_BLUETOOTH" /**< Bluetooth audio id */
/**
* @brief Definition of Wi-Fi audio id.
-* @since_tizen 5.0
+* @since_tizen 4.0
*/
#define VCE_AUDIO_ID_WIFI "VC_AUDIO_ID_WIFI" /**< Wi-Fi audio id */
/**
* @brief Definition for none message.
-* @since_tizen 5.0
+* @since_tizen 4.0
*/
#define VC_RESULT_MESSAGE_NONE "vc.result.message.none"
/**
* @brief Definition for failed recognition because the speech is too loud to listen.
-* @since_tizen 5.0
+* @since_tizen 4.0
*/
#define VC_RESULT_MESSAGE_ERROR_TOO_LOUD "vc.result.message.error.too.loud"
/**
* @brief Called when VC engine informs the engine service user about whole supported languages.
* @details This callback function is implemented by the engine service user. Therefore, the engine developer does NOT have to implement this callback function.
-* @since_tizen 5.0
+* @since_tizen 4.0
* @remarks This callback function is called by vce_foreach_supported_languages_cb() to retrieve the whole supported language list.
* The @a user_data must be transferred from vce_foreach_supported_languages_cb().
* The @a language can be used only in the callback. To use outside, make a copy.
/**
* @brief Called when the engine service user initializes Voice Control (VC) engine.
-* @since_tizen 5.0
+* @since_tizen 4.0
* @remarks This callback function is mandatory and must be registered using vce_main().
* @return 0 on success, otherwise a negative error value
* @retval #VCE_ERROR_NONE Successful
/**
* @brief Called when the engine service user deinitializes VC engine.
-* @since_tizen 5.0
+* @since_tizen 4.0
* @remarks This callback function is mandatory and must be registered using vce_main().
* @return 0 on success, otherwise a negative error value
* @retval #VCE_ERROR_NONE Successful
/**
* @brief Called when the engine service user requests the recording format of VC engine.
-* @since_tizen 5.0
+* @since_tizen 4.0
* @remarks This callback function is mandatory and must be registered using vce_main().
* The @a audio_id can be used only in the callback. To use outside, make a copy.
+* The @a types is managed by the platform and will be released when this callback function is completed.
+* The @a rate is managed by the platform and will be released when this callback function is completed.
+* The @a channels is managed by the platform and will be released when this callback function is completed.
* @param[in] audio_id The audio device id. (e.g. #VCE_AUDIO_ID_BLUETOOTH or #VCE_AUDIO_ID_WIFI)
* @param[out] types The format used by the recorder.
* @param[out] rate The sample rate used by the recorder.
/**
* @brief Called when the engine service user retrieves all supported languages of VC engine.
-* @since_tizen 5.0
+* @since_tizen 4.0
* @remarks This callback function is mandatory and must be registered using vce_main().
* @param[in] callback a callback function
* @param[in] user_data The user data to be passed to the callback function
/**
* @brief Called when the engine service user checks whether a language is supported or not.
-* @since_tizen 5.0
+* @since_tizen 4.0
* @remarks This callback function is mandatory and must be registered using vce_main().
* The @a language can be used only in the callback. To use outside, make a copy.
* @param[in] language A language
/**
* @brief Called when the engine service user sets language.
-* @since_tizen 5.0
+* @since_tizen 4.0
* @remarks The @a language can be used only in the callback. To use outside, make a copy.
* @param[in] language A language.
* @return 0 on success, otherwise a negative error value
/**
* @brief Called when the engine service user sets command list before recognition.
-* @since_tizen 5.0
+* @since_tizen 4.0
* @remarks This function should set commands via vcd_foreach_command().
+* The @a vc_command should not be released.
+* The @a vc_command can be used only in the callback. To use outside, make a copy.
* @param[in] vc_command command handle. The @a vc_command can be used only in the callback. To use outside, make a copy.
* @return 0 on success, otherwise a negative error value
* @retval #VCE_ERROR_NONE Successful
/**
* @brief Called when the engine service user unsets command list for reset.
-* @since_tizen 5.0
+* @since_tizen 4.0
* @return 0 on success, otherwise a negative error value
* @retval #VCE_ERROR_NONE Successful
* @retval #VCE_ERROR_INVALID_PARAMETER Invalid parameter
/**
* @brief Called when the engine service user starts recognition.
-* @since_tizen 5.0
+* @since_tizen 4.0
* @remarks This callback function is mandatory and must be registered using vce_main().
* @param[in] stop_by_silence Silence detection option.
* @c true to detect the silence,
/**
* @brief Called when the engine service user sets recording data for speech recognition from recorder.
-* @since_tizen 5.0
+* @since_tizen 4.0
* @remarks This function should be returned immediately after recording data copy.
* The @a data can be used only in the callback. To use outside, make a copy.
+* The @a speech_detected should not be released. This is managed by the platform.
* @param[in] data A recording data
* @param[in] length A length of recording data
* @param[out] speech_detected The status of speech (e.g. #VCE_SPEECH_DETECT_BEGIN or #VCE_SPEECH_DETECT_END). The @a speech_detected can be used only in the callback. To use outside, make a copy.
/**
* @brief Called when the engine service user stops to get the result of recognition.
-* @since_tizen 5.0
+* @since_tizen 4.0
* @return 0 on success, otherwise a negative error value
* @retval #VCE_ERROR_NONE Successful
* @retval #VCE_ERROR_INVALID_STATE Invalid state
/**
* @brief Called when the engine service user cancels the recognition process.
-* @since_tizen 5.0
+* @since_tizen 4.0
* @return 0 on success, otherwise a negative error value.
* @retval #VCE_ERROR_NONE Successful.
* @retval #VCE_ERROR_INVALID_STATE Invalid state.
/**
* @brief Called when the engine service user sets audio recording type.
-* @since_tizen 5.0
-* @remarks The @a audio can be used only in the callback. To use outside, make a copy.
+* @since_tizen 4.0
+* @remarks The @a audio_type can be used only in the callback. To use outside, make a copy.
* @param[in] audio_type Current audio type (e.g. #VCE_AUDIO_ID_BLUETOOTH or #VCE_AUDIO_ID_WIFI)
* @return 0 on success, otherwise a negative error value.
* @retval #VCE_ERROR_NONE Successful.
/**
* @brief Called when the engine service user sets app id which is want to ask server dialog.
-* @since_tizen 5.0
+* @since_tizen 4.0
* @remarks The @a app_id and @a credential can be used only in the callback. To use outside, make a copy.
* @param[in] app_id App id which is to want to ask server dialog.
* @param[in] credential Credential key.
/**
* @brief Called when the engine service user sets domain (agent or device type).
-* @since_tizen 5.0
+* @since_tizen 4.0
* @remarks The @a domain can be used only in the callback. To use outside, make a copy.
* @param[in] domain Agent (e.g. "music", "news", etc) or device type (e.g. "tv", "mobile", etc) corresponding to the command
* @return 0 on success, otherwise a negative error value.
/**
* @brief Called when the engine service user requests essential value from NLU result.
-* @since_tizen 5.0
+* @since_tizen 4.0
* @remarks The @a key can be used only in the callback. To use outside, make a copy.
+* The @a value is managed by the platform and will be released when this callback function is completed.
* @param[in] key NLU base info key.
* @param[out] value NLU base info value.
* @return 0 on success, otherwise a negative error value.
/**
* @brief Called when client gets the specific engine's request from the engine service user.
-* @since_tizen 5.0
+* @since_tizen 4.0
+* @remarks The @a engine_app_id is managed by the platform and will be released when this callback function is completed.
+* The @a event is managed by the platform and will be released when this callback function is completed.
+* The @a request is managed by the platform and will be released when this callback function is completed.
*
* @param[in] engine_app_id The specific engine's app id
* @param[in] event The specific engine event type
/**
* @brief Called when the engine service user sets private data between app and engine.
-* @since_tizen 5.0
+* @since_tizen 4.0
* @remarks The @a key, @a data can be used only in the callback. To use outside, make a copy.
* @param[in] key Private key.
* @param[in] data Private data.
/**
* @brief Called when the engine service user requests private data between app and engine.
-* @since_tizen 5.0
+* @since_tizen 4.0
* @remarks The @a key can be used only in the callback. To use outside, make a copy.
+* The @a data is managed by the platform and will be released when this callback function is completed.
* @param[in] key Private key.
* @param[out] data Private data.
* @return 0 on success, otherwise a negative error value.
/**
* @brief Called when the engine service user requests process text.
-* @since_tizen 5.0
+* @since_tizen 4.0
* @remarks The @a text can be used only in the callback. To use outside, make a copy.
* @param[in] text Requested text
* @return 0 on success, otherwise a negative error value.
/**
* @brief Called when the engine service user requests list event.
-* @since_tizen 5.0
+* @since_tizen 4.0
* @remarks The @a event can be used only in the callback. To use outside, make a copy.
* @param[in] event Requested list event
* @return 0 on success, otherwise a negative error value.
/**
* @brief Called when the engine service user requests haptic event.
-* @since_tizen 5.0
+* @since_tizen 4.0
* @remarks The @a event can be used only in the callback. To use outside, make a copy.
* @param[in] event Requested haptic event
* @return 0 on success, otherwise a negative error value.
/**
* @brief Called when the engine service user requests the base information of VC engine.
-* @since_tizen 5.0
+* @since_tizen 4.0
* @remarks This callback function is mandatory and must be registered using vce_main().
-* The allocated @a engine_uuid, @a engine_name, and @a engine_settings_app_id will be released internally.
+* The @a engine_uuid is managed by the platform and will be released when this callback function is completed.
+* The @a engine_name is managed by the platform and will be released when this callback function is completed.
+* The @a engine_settings_app_id is managed by the platform and will be released when this callback function is completed.
+* The @a use_network is managed by the platform and will be released when this callback function is completed.
* In order to upload the engine to Tizen Appstore, both the service app and the UI app (engine settings) are necessary.
* Therefore, @a engine_settings_app_id should be set to the application ID of the UI application.
* If there is no UI application, then @a engine_settings_app_id should be set to NULL.
/**
* @brief Called to retrieve the commands.
-* @since_tizen 5.0
+* @since_tizen 4.0
* @remarks The @a command, @a param can be used only in the callback. To use outside, make a copy.
* @param[in] id command id
* @param[in] type command type
/**
* @brief A structure for the VC engine functions.
* @details This structure contains essential callback functions for operating VC engine.
-* @since_tizen 5.0
+* @since_tizen 4.0
* @remarks These functions ar mandatory for operating VC engine. Therefore, all functions MUST be implemented.
*/
typedef struct {
vce_process_haptic_event_cb process_haptic_event; /**< Request to process haptic event */
/* Optional callbacks */
- vce_private_data_set_cb private_data_set;
+ vce_private_data_set_cb private_data_set;
vce_private_data_requested_cb private_data_request;
vce_nlu_base_info_requested_cb nlu_base_info_request;
vce_specific_engine_request_cb specific_engine_request;
} vce_request_callback_s;
/**
-* @brief Main function for Voice Control (VC) engine.
+* @brief Starts the main function for Voice Control (VC) engine.
* @details This function is the main function for operating VC engine.
-* @since_tizen 5.0
+* @since_tizen 4.0
* @privlevel public
* @privilege %http://tizen.org/privilege/recorder
* @remarks The service_app_main() should be used for working the engine after this function.
/**
* @brief Sends the results to the engine service user.
-* @since_tizen 5.0
+* @since_tizen 4.0
* @param[in] event A result event
* @param[in] result_id Result ids
* @param[in] count Result count
* @retval #VCE_ERROR_INVALID_STATE Invalid state
* @retval #VCE_ERROR_OPERATION_FAILED Operation failure
* @pre The vce_main() function should be invoked before this function is called.
-* vce_stop_cb() will invoke this callback.
+* vce_stop_cb() will invoke this callback.
* @see vce_stop_cb()
*/
int vce_send_result(vce_result_event_e event, int* result_id, int count, const char* all_result, const char* non_fixed_result, const char* nlu_result, const char* msg, int* user_info, void* user_data);
/**
* @brief Sends the ASR result to the engine service user.
-* @since_tizen 5.0
+* @since_tizen 4.0
* @param[in] event A asr result event
* @param[in] asr_result A asr result text
* @param[in] user_data The user data passed from the start
/**
* @brief Sends the NLG (Natural Language Generation) result to the engine service user.
-* @since_tizen 5.0
+* @since_tizen 4.0
* @param[in] nlg_result A nlg result
* @param[in] user_data The user data passed from the start
* @return @c 0 on success, otherwise a negative error value
/**
* @brief Sends the specific engine result to the engine service user.
-* @since_tizen 5.0
+* @since_tizen 4.0
*
* @param[in] engine_app_id A specific engine's app id
* @param[in] event A specific engine result event
* @param[in] result A specific engine result text
-* @param[in] user_data The user data passed from the start
+* @param[in] user_info The user info passed from the start
*
* @return 0 on success, otherwise a negative error value
* @retval #VCE_ERROR_NONE Successful
* #VCE_ERROR_OPERATION_FAILED, \n
* #VCE_ERROR_PERMISSION_DENIED, \n
* #VCE_ERROR_NOT_SUPPORTED_FEATURE.
-* @since_tizen 5.0
+* @since_tizen 4.0
* @param[in] error Error type
* @param[in] msg Error message
* @param[in] user_data The user data passed from set callback function
/**
* @brief Sets a callback function for setting the private data to the engine service.
-* @since_tizen 5.0
+* @since_tizen 4.0
* @privlevel public
* @privilege %http://tizen.org/privilege/recorder
* @remarks The vce_private_data_set_cb() function is called when the engine service user sets the private data to the engine service.
/**
* @brief Sets a callback function for requesting the private data to the engine service.
-* @since_tizen 5.0
+* @since_tizen 4.0
* @privlevel public
* @privilege %http://tizen.org/privilege/recorder
* @remarks The vce_private_data_requested_cb() function is called when the engine service user requests the private data to the engine service.
/**
* @brief Sets a callback function for requesting the NLU base information to the engine service.
-* @since_tizen 5.0
+* @since_tizen 4.0
* @remarks The vce_nlu_base_info_requested_cb() function is called when the engine service user requests the NLU base information to the engine service.
* @param[in] callback_func vce_nlu_base_info_requested event callback function
* @return @c 0 on success, otherwise a negative error value
int vce_set_nlu_base_info_requested_cb(vce_nlu_base_info_requested_cb callback_func);
/**
-* @brief Registers a callback function for getting the engine service request.
-* @since_tizen 5.0
+* @brief Sets a callback function for getting the engine service request.
+* @since_tizen 4.0
*
-* @param[in] callback Callback function to register
-* @param[in] user_data The user data to be passed to the callback function
+* @param[in] callback_func Callback function to register
*
* @return 0 on success, otherwise a negative error value
* @retval #VCE_ERROR_NONE Successful
* @retval #VCE_ERROR_INVALID_PARAMETER Invalid parameter
-* @retval #VCE_ERROR_PERMISSION_DENIED Permission denied
* @retval #VCE_ERROR_NOT_SUPPORTED Not supported
*
* @see vce_unset_specific_engine_request_cb()
int vce_set_specific_engine_request_cb(vce_specific_engine_request_cb callback_func);
/**
-* @brief Unregisters the engine service request callback function.
-* @since_tizen 5.0
+* @brief Unsets the engine service request callback function.
+* @since_tizen 4.0
*
* @return 0 on success, otherwise a negative error value
* @retval #VC_ERROR_NONE Successful
-* @retval #VC_ERROR_PERMISSION_DENIED Permission denied
* @retval #VC_ERROR_NOT_SUPPORTED Not supported
*
* @see vce_set_specific_engine_request_cb()
/**
* @brief Retrieves all commands using callback function.
-* @since_tizen 5.0
+* @since_tizen 4.0
+*
* @param[in] vce_command The handle to be passed to the vce_set_commands() function
* @param[in] callback The callback function to invoke
* @param[in] user_data The user data to be passed to the callback function
+*
* @return 0 on success, otherwise a negative error value
* @retval #VCE_ERROR_NONE Successful
* @retval #VCE_ERROR_INVALID_PARAMETER Invalid parameter
* @retval #VCE_ERROR_OPERATION_FAILED Operation failure
* @retval #VCE_ERROR_INVALID_STATE Invalid state
-* @post This function invokes vce_command_cb() repeatedly for getting commands.
+* @post This function invokes vce_command_cb() repeatedly for getting commands.
* @see vce_foreach_command_cb()
* @see vce_set_commands()
*/
/**
* @brief Gets command length.
-* @since_tizen 5.0
+* @since_tizen 4.0
+*
* @param[in] vce_command The handle to be passed to the vce_set_commands() function
* @param[out] count The command count value
+*
* @return 0 on success, otherwise a negative error value.
* @retval #VCE_ERROR_NONE Successful
* @retval #VCE_ERROR_INVALID_PARAMETER Invalid parameter
/**
* @brief Gets current audio type.
-* @since_tizen 5.0
+* @since_tizen 4.0
* @privlevel public
* @privilege %http://tizen.org/privilege/recorder
* @remarks The @a audio_type must be released using free() when it is no longer required.
/**
* @brief Sets private data to a voice manager client.
-* @since_tizen 5.0
+* @since_tizen 4.0
* @privlevel public
* @privilege %http://tizen.org/privilege/recorder
* @param[in] key Private key
/**
* @brief Gets private data from a voice manager client.
-* @since_tizen 5.0
+* @since_tizen 4.0
* @privlevel public
* @privilege %http://tizen.org/privilege/recorder
* @remarks The @a data must be released using free() when it is no longer required.
/**
* @brief Starts recording voice.
-* @since_tizen 5.0
+* @since_tizen 4.0
* @privlevel public
* @privilege %http://tizen.org/privilege/recorder
* @return 0 on success, otherwise a negative error value.
/**
* @brief Stops recording voice.
-* @since_tizen 5.0
+* @since_tizen 4.0
* @privlevel public
* @privilege %http://tizen.org/privilege/recorder
* @return 0 on success, otherwise a negative error value.
/* for TTS feeadback */
/**
* @brief Sends audio formats necessary for playing TTS feedback.
-* @since_tizen 5.0
+* @since_tizen 4.0
+*
+* @param[in] rate A sampling rate
+* @param[in] channel The audio channel
+* @param[in] audio_type The audio type
+*
* @return 0 on success, otherwise a negative error value.
* @retval #VCE_ERROR_NONE Successful
-* @retval #VCE_ERROR_PERMISSION_DENIED Permission denied
* @retval #VCE_ERROR_NOT_SUPPORTED Not supported
+* @retval #VCE_ERROR_INVALID_PARAMETER Invalid parameter
* @retval #VCE_ERROR_OPERATION_FAILED Operation failure
* @retval #VCE_ERROR_OUT_OF_MEMORY Out of Memory
*/
/**
* @brief Sends audio streaming necessary for playing TTS feedback.
-* @since_tizen 5.0
+* @since_tizen 4.0
+*
+* @param[in] event A feedback event
+* @param[in] buffer The feedback data
+* @param[in] len The length of the feedback data
+*
* @return 0 on success, otherwise a negative error value.
* @retval #VCE_ERROR_NONE Successful
-* @retval #VCE_ERROR_PERMISSION_DENIED Permission denied
* @retval #VCE_ERROR_NOT_SUPPORTED Not supported
+* @retval #VCE_ERROR_INVALID_PARAMETER Invalid parameter
* @retval #VCE_ERROR_OPERATION_FAILED Operation failure
* @retval #VCE_ERROR_OUT_OF_MEMORY Out of Memory
*/