/*
- * Samsung TTS
- * Copyright 2012-2014 Samsung Electronics Co., Ltd
+ * Copyright 2018 Samsung Electronics Co., Ltd
*
* Licensed under the Flora License, Version 1.1 (the License);
* you may not use this file except in compliance with the License.
extern "C" {
#endif
-/*
-#define ENGINE_UUID "27F277E9-BBC4-4dca-B553-D9884A3CDAA0"
-#define ENGINE_NAME "Samsung TTS"
-#define ENGINE_UG_NAME "tts_smt_setting_ug.so"
-*/
-
typedef enum {
WAKEUP_EVENT_ERROR = -1, /**< Event when the wakeup recognition has failed */
WAKEUP_EVENT_SUCCESS = 1, /**< Event when the wakeup word is matched succesfully */
+++ /dev/null
-/*
- * Samsung TTS
- * Copyright 2012-2014 Samsung Electronics Co., Ltd
- *
- * Licensed under the Flora License, Version 1.1 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://floralicense.org/license/
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-#ifndef _MULTI_WAKEUP_RECOGNIZER_H_
-#define _MULTI_WAKEUP_RECOGNIZER_H_
-
-#include <dlog/dlog.h>
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
-#define ENGINE_UUID "27F277E9-BBC4-4dca-B553-D9884A3CDAA0"
-#define ENGINE_NAME "Samsung TTS"
-#define ENGINE_UG_NAME "tts_smt_setting_ug.so"
-*/
-
-#ifdef LOG_TAG
-#undef LOG_TAG
-#endif
-#define LOG_TAG "multi-wakeup"
-
-typedef enum {
- WAKEUP_EVENT_ERROR = -1, /**< Event when the wakeup recognition has failed */
- WAKEUP_EVENT_SUCCESS = 1, /**< Event when the wakeup word is matched succesfully */
- WAKEUP_EVENT_REJECTED = 2 /**< Event when the wakeup word is not matched */
-} wakeup_service_wakeup_event_e;
-
-typedef enum {
- WAKEUP_SPEECH_STREAMING_EVENT_FAIL = -1, /**< Failed */
- WAKEUP_SPEECH_STREAMING_EVENT_START = 1, /**< Start event */
- WAKEUP_SPEECH_STREAMING_EVENT_CONTINUE = 2, /**< Continue event */
- WAKEUP_SPEECH_STREAMING_EVENT_FINISH = 3 /**< Finish event */
-} wakeup_service_speech_streaming_event_e;
-
-typedef enum {
- WAKEUP_SPEECH_STATUS_NONE = -1, /**< None */
- WAKEUP_SPEECH_STATUS_STARTED = 1, /**< Event when speech is started */
- WAKEUP_SPEECH_STATUS_COMPLETED = 2, /**< Event when speech is completed (EPD) */
- WAKEUP_SPEECH_STATUS_CANCELED = 3 /**< Event when speech is cancelled */
-} wakeup_service_speech_status_e;
-
-
-typedef void (*wakeup_service_wakeup_event_cb)(wakeup_service_wakeup_event_e event, void* user_data);
-
-typedef void (*wakeup_service_speech_streaming_cb)(wakeup_service_speech_streaming_event_e event, char* buffer, int len, void *user_data);
-
-typedef void (*wakeup_service_speech_status_cb)(wakeup_service_speech_status_e status, void *user_data);
-
-
-int wakeup_service_initialize(void);
-
-int wakeup_service_deinitialize(void);
-
-int wakeup_service_set_language(const char* language);
-
-int wakeup_service_set_wakeup_word(const char* language, const char* wakeup_word);
-
-int wakeup_service_start_recording(void);
-
-int wakeup_service_stop_recording(void);
-
-int wakeup_service_cancel_recording(void);
-
-int wakeup_service_set_wakeup_event_callback(wakeup_service_wakeup_event_cb callback, void* user_data);
-
-int wakeup_service_set_speech_streaming_callback(wakeup_service_speech_streaming_cb callback, void* user_data);
-
-int wakeup_service_set_speech_status_callback(wakeup_service_speech_status_cb callback, void* user_data);
-
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _MULTI_WAKEUP_RECOGNIZER_H_ */
#include <app_manager.h>
#include <app.h>
#include <malloc.h>
+#include <Ecore.h>
#include <stdio.h>
#include <stdlib.h>
return ret;
}
+Eina_Bool __start_recording(void *data)
+{
+ (void)data;
+
+ MAS_LOGD("[Enter] Start Recording again");
+ int ret = multi_assistant_service_plugin_start_recording();
+ if (0 != ret) {
+ MAS_LOGE("[ERROR] Fail to start recording, ret(%d)", ret);
+ }
+ return EINA_FALSE;
+}
+
int mas_client_send_result(int pid, char* display_text, char* utterance_text, char* result_json)
{
MAS_LOGD("[Enter] pid(%d), display_text(%s), utterance_text(%s), result_json(%s)", pid, display_text, utterance_text, result_json);
MAS_LOGE("[ERROR] Fail to send result, ret(%d)", ret);
}
+ ecore_timer_add(0, __start_recording, NULL);
+
return ret;
}
#endif
-/* + TEST_CODE */
+#if 0 /* + TEST_CODE */
Eina_Bool __send_asr_result(void *data)
{
MAS_LOGD("[ENTER]");
MAS_LOGD("END");
return EINA_FALSE;
}
+#endif /* -TEST_CODE */
Eina_Bool __request_speech_data(void *data)
{
MAS_LOGD("END");
return EINA_FALSE;
}
-/* -TEST_CODE */
static void __wakeup_event_cb(wakeup_service_wakeup_event_e event, const char* wakeup_word, void* user_data)
{
}
}
- /* TEST_CODE */
+#if 0 /* + TEST_CODE */
if (WAKEUP_EVENT_SUCCESS == event) {
ecore_thread_main_loop_begin();
ecore_timer_add(1.0, __send_asr_result, "Today's");
ecore_thread_main_loop_begin();
ecore_timer_add(3.0, __send_result, "Partly cloudy with temperatures from 75 to 88");
ecore_thread_main_loop_end();
+ }
+#endif /* - TEST_CODE */
+ // if App is already launched, request speech data
+ /* TO_DO */
+ if (WAKEUP_EVENT_SUCCESS == event) {
ecore_thread_main_loop_begin();
- ecore_timer_add(4.0, __request_speech_data, NULL);
+ ecore_timer_add(0, __request_speech_data, NULL);
ecore_thread_main_loop_end();
}
}
int multi_assistant_service_plugin_request_speech_data(void)
{
- int ret = wakeup_service_cancel_recording();
+ int ret = wakeup_service_request_speech_data();
if (0 != ret) {
- MAS_LOGE("[ERROR] Fail to cancel recording, ret(%d)", ret);
+ MAS_LOGE("[ERROR] Fail to request speech data, ret(%d)", ret);
}
return ret;
}