2 * Copyright (c) 2011-2016 Samsung Electronics Co., Ltd All Rights Reserved
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 * http://www.apache.org/licenses/LICENSE-2.0
7 * Unless required by applicable law or agreed to in writing, software
8 * distributed under the License is distributed on an "AS IS" BASIS,
9 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10 * See the License for the specific language governing permissions and
11 * limitations under the License.
16 #ifndef __STT_ENGINE_H_
17 #define __STT_ENGINE_H_
27 typedef int (*stt_engine_result_cb)(stte_result_event_e event, const char* type, const char** data, int data_count,
28 const char* msg, void* time_info, void* user_data);
31 * STT Engine Interfaces
35 /* Register engine id */
36 int stt_engine_load(const char* filepath, stte_request_callback_s *callback);
38 /* Unregister engine id */
39 int stt_engine_unload();
43 int stt_engine_initialize(bool is_from_lib);
45 int stt_engine_deinitialize();
48 int stt_engine_get_supported_langs(GSList** lang_list);
50 int stt_engine_is_valid_language(const char* language, bool *is_valid);
52 int stt_engine_set_private_data(const char* key, const char* data);
54 int stt_engine_get_private_data(const char* key, char** data);
56 int stt_engine_get_first_language(char** language);
58 int stt_engine_support_silence(bool* support);
60 int stt_engine_need_app_credential(bool* need);
62 int stt_engine_support_recognition_type(const char* type, bool* support);
64 int stt_engine_get_audio_format(stte_audio_type_e* types, int* rate, int* channels);
67 int stt_engine_set_silence_detection(bool value);
70 int stt_engine_check_app_agreed(const char* appid, bool* is_agreed);
73 int stt_engine_recognize_start(const char* lang, const char* recognition_type, const char* appid, const char* credential, void* user_param);
75 int stt_engine_set_recording_data(const void* data, unsigned int length);
77 int stt_engine_recognize_stop();
79 int stt_engine_recognize_cancel();
81 int stt_engine_foreach_result_time(void* time_info, stte_result_time_cb callback, void* user_data);
84 /* File recognition */
85 int stt_engine_recognize_start_file(const char* lang, const char* recognition_type,
86 const char* filepath, stte_audio_type_e audio_type, int sample_rate, void* user_param);
88 int stt_engine_recognize_cancel_file();
90 int stt_engine_set_recognition_result_cb(stt_engine_result_cb result_cb, void* user_data);
92 int stt_engine_get_recognition_result_cb(stt_engine_result_cb* result_cb);
94 int stt_engine_set_private_data_set_cb(stte_private_data_set_cb private_data_set_cb, void* user_data);
96 int stt_engine_set_private_data_requested_cb(stte_private_data_requested_cb private_data_requested_cb, void* user_data);
98 int stt_engine_set_audio_type(const char* audio_type);
100 int stt_engine_set_audio_type_set_cb(stte_audio_type_cb audio_type_set_cb, void* user_data);
102 int stt_engine_unset_audio_type_set_cb(void);
108 #endif /* __STT_ENGINE_H_ */