return ret;
}
-int vc_dialog(const char* disp_text, const char* utt_text, bool auto_start)
+int vc_request_dialog(const char* disp_text, const char* utt_text, bool auto_start)
{
vc_state_e state;
if (0 != __vc_cmd_get_feature_enabled()) {
return VC_ERROR_NOT_SUPPORTED;
}
- if (0 != __vc_cmd_check_privilege()) {
- return VC_ERROR_PERMISSION_DENIED;
- }
if (NULL == vc_command || NULL == command) {
SLOG(LOG_ERROR, TAG_VCCMD, "[ERROR] Invalid handle ");
if (0 != __vc_cmd_get_feature_enabled()) {
return VC_ERROR_NOT_SUPPORTED;
}
- if (0 != __vc_cmd_check_privilege()) {
- return VC_ERROR_PERMISSION_DENIED;
- }
if (NULL == vc_command) {
SLOG(LOG_ERROR, TAG_VCCMD, "[ERROR] Invalid parameter ");
if (0 != __vc_cmd_get_feature_enabled()) {
return VC_ERROR_NOT_SUPPORTED;
}
- if (0 != __vc_cmd_check_privilege()) {
- return VC_ERROR_PERMISSION_DENIED;
- }
if (NULL == vc_command || NULL == format) {
SLOG(LOG_ERROR, TAG_VCCMD, "[ERROR] Invalid parameter ");
int vc_cmd_get_fixed_command(vc_cmd_h vc_command, char** fixed);
/**
-* @brief Gets fixed command
-* @since_tizen 3.0
-*
-* @param[in] vc_command The command handle
-* @param[out] fixed Fixed command
-*
-* @return 0 on success, otherwise a negative error value
-* @retval #VC_CMD_ERROR_NONE Successful
-* @retval #VC_CMD_ERROR_INVALID_PARAMETER Invalid parameter
-* @retval #VC_CMD_ERROR_NOT_SUPPORTED Not supported feature
-*
-* @see vc_cmd_set_unfixed_command()
-*/
-int vc_cmd_get_unfixed_command(vc_cmd_h vc_command, char** command);
-
-/**
* @brief Sets invocation name.
* @since_tizen 3.0
*
* 4-3. Set command and type for command handle <br>
* 4-4. Add command handle to command list <br>
* 5. Set command list for recognition <br>
- * 6. If an application wants to finish voice control,<br>
- * 6-1. Destroy command and command list handle <br>
- * 6-2. Deinitialize <br>
+ * 6. Set an invocation name for an application <br>
+ * 7. Get recognition results <br>
+ * 8. Request the dialogue <br>
+ * 9. If an application wants to finish voice control,<br>
+ * 9-1. Destroy command and command list handle <br>
+ * 9-2. Deinitialize <br>
*
* An application can obtain command handle from command list, and also get information from handle.
*
* <td></td>
* </tr>
* <tr>
+ * <td>vc_get_result()</td>
+ * <td>Ready</td>
+ * <td></td>
+ * </tr>
+ * <tr>
+ * <td>vc_get_system_command_list()</td>
+ * <td>Ready</td>
+ * <td></td>
+ * </tr>
+ * <tr>
* <td>vc_set_command_list()</td>
* <td>Ready</td>
* <td></td>
* <td></td>
* </tr>
* <tr>
+ * <td>vc_set_invocation_name()</td>
+ * <td>Ready</td>
+ * <td></td>
+ * </tr>
+ * <tr>
+ * <td>vc_request_dialog()</td>
+ * <td>Ready</td>
+ * <td></td>
+ * </tr>
+ * <tr>
* <td>
* vc_set_result_cb()<br>
* vc_unset_result_cb()<br>
int vc_get_system_command_list(vc_cmd_list_h* vc_sys_cmd_list);
/**
- * @brief Sets invocation name.
+ * @brief Sets the invocation name.
* @since_tizen 3.0
* @privlevel public
* @privilege %http://tizen.org/privilege/recorder
*
- * @remarks Invocation name is used to activate background commands. The invocation name can be set as the application name or some words.
- * For example, an application "Tizen Sample" has a background command, "Play music", and the invocation name of the application is set as "Tizen Sample".
+ * @remarks Invocation name is used to activate background commands. The invocation name can be the same as the application name or any other phrase.
+ * For example, an application "Tizen Sample" has a background command, "Play music", and the invocation name of the application is set to "Tizen Sample".
* In order to activate the background command, users can say "Tizen Sample, Play music".
- * The invocation name is dependent on the setting language. For example, if the setting language is "en_US"(English), the invocation name is also "en_US".
- * If the setting language is "ja_JP"(Japanese) and the invocation name is "en_US", the invocation name will not be recognized.
+ * The invocation name is dependent on the current language. For example, if the current language is "en_US"(English), the invocation name is also "en_US".
+ * If the current language is "ja_JP"(Japanese) and the invocation name is "en_US", the invocation name will not be recognized.
* This function should be called before vc_set_command_list().
*
* @param[in] name Invocation name that an application wants to be invoked by
/**
* @brief Requests to start the dialogue.
- * @details Using this function, the developer can transfer texts, for starting the dialogue, to the framework.
- * There are two types of texts. One is a text for displaying, and the other is that for uttering.
+ * @details Using this function, the developer can request starting the dialogue to the framework.
+ * When the developer requests the dialogue, two types of texts, @a disp_text and @a utt_text, can be sent by this function.
+ * @a disp_text is a text for displaying, and @a utt_text is that for uttering.
* For example, if @a disp_text is "October 10th" and @a utt_text is "Today is October 10th.", "October 10th" will be displayed on the screen and "Today is October 10th." will be spoken.
- * Also, the developer can set whether the dialogue restarts automatically or not, using @a auto_start.
+ * Also, the developer can set whether the dialogue starts automatically or not, using @a auto_start.
+ * If the developer sets @a auto_start as @c true, the framework will start to record next speech and continue the dialogue.
*
* @since_tizen 3.0
* @privlevel public
* @privilege %http://tizen.org/privilege/recorder
*
- * @remarks If @a auto_start is @c true, the recognition will start again. In this case, 4 times can be restarted.
+ * @remarks If @a auto_start is @c true, the recognition will start again. In this case, it can be restarted up to 4 times.
*
* @param[in] disp_text Text to be displayed on the screen
* @param[in] utt_text Text to be spoken
/**
+ * @brief Definition for fixed command format
+ * @since_tizen 3.0
+ */
+#define VC_CMD_FORMAT_FIXED 0
+
+/**
+ * @brief Definition for fixed and variable fixed command format
+ * @since_tizen 3.0
+ */
+#define VC_CMD_FORMAT_FIXED_AND_VFIXED 1
+
+/**
+ * @brief Definition for variable fixed and fixed command format
+ * @since_tizen 3.0
+ */
+#define VC_CMD_FORMAT_VFIXED_AND_FIXED 2
+
+/**
+ * @brief Definition for fixed and non-fixed command format
+ * @since_tizen 3.0
+ */
+#define VC_CMD_FORMAT_FIXED_AND_NONFIXED 3
+
+/**
+ * @brief Definition for non-fixed and fixed command format
+ * @since_tizen 3.0
+ */
+#define VC_CMD_FORMAT_NONFIXED_AND_FIXED 4
+
+
+/**
* @brief The voice command handle.
* @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
*/
int vc_cmd_list_foreach_commands(vc_cmd_list_h vc_cmd_list, vc_cmd_list_cb callback, void* user_data);
/**
- * @brief Retrieves all commands on the system command list using callback function.
+ * @brief Retrieves all commands on the system command list using a callback function.
* @since_tizen 3.0
*
* @param[in] callback Callback function to invoke
* @brief Gets the unfixed command.
* @since_tizen 3.0
*
- * @remark After this function is successfully conducted, the @a command must be released with free() if it is not NULL.
- * If the command in @a vc_command is NULL, @a command will be also NULL.
+ * @remark If the function succeeds, the @a command must be released with free() if it is not NULL.
+ * If the command of the given @a vc_command is NULL (@a vc_command is NOT NULL), @a command will be also NULL.
* This function should be used for commands which have non-fixed format.
*
* @param[in] vc_command The command handle
* @since_tizen 3.0
*/
typedef enum {
- VC_CMD_FORMAT_FIXED = 0, /**< fixed command only */
+ VC_CMD_FORMAT_FIXED = 0, /**< Fixed command only */
VC_CMD_FORMAT_FIXED_AND_VFIXED, /**< Fixed + variable fixed command */
VC_CMD_FORMAT_VFIXED_AND_FIXED, /**< Variable fixed + fixed command */
VC_CMD_FORMAT_FIXED_AND_NONFIXED, /**< Fixed + non fixed command */
VC_ERROR_ITERATION_END = TIZEN_ERROR_VOICE_CONTROL | 0x016, /**< List reached end */
VC_ERROR_EMPTY = TIZEN_ERROR_VOICE_CONTROL | 0x017, /**< List empty */
VC_ERROR_SERVICE_RESET = TIZEN_ERROR_VOICE_CONTROL | 0x018, /**< Service daemon reset (Since 3.0) */
- VC_ERROR_IN_PROGRESS_TO_READY = TIZEN_ERROR_VOICE_CONTROL | 0x019, /**< In process to ready (Since 3.0) */
- VC_ERROR_IN_PROGRESS_TO_RECORDING = TIZEN_ERROR_VOICE_CONTROL | 0x020, /**< In process to recording (Since 3.0) */
- VC_ERROR_IN_PROGRESS_TO_PROCESSING = TIZEN_ERROR_VOICE_CONTROL | 0x021 /**< In process to processing (Since 3.0) */
+ VC_ERROR_IN_PROGRESS_TO_READY = TIZEN_ERROR_VOICE_CONTROL | 0x019, /**< In progress to ready (Since 3.0) */
+ VC_ERROR_IN_PROGRESS_TO_RECORDING = TIZEN_ERROR_VOICE_CONTROL | 0x020, /**< In progress to recording (Since 3.0) */
+ VC_ERROR_IN_PROGRESS_TO_PROCESSING = TIZEN_ERROR_VOICE_CONTROL | 0x021 /**< In progress to processing (Since 3.0) */
} vc_error_e;
/**