Add checking personal voice and create speak data with personal voice id
[platform/core/uifw/tts.git] / server / ttsd_server.h
1 /*
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.
12 */
13
14
15 #ifndef __TTSD_SERVER_CORE_H_
16 #define __TTSD_SERVER_CORE_H_
17
18 #include <glib.h>
19 #include <Ecore.h>
20
21 #include "ttse.h"
22 #include "tts_ipc_method.h"
23
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27
28 /**
29 * Server APIs
30 */
31 int ttsd_initialize(ttse_request_callback_s *callback);
32
33 int ttsd_finalize();
34
35 int ttsd_terminate();
36
37 int ttsd_send_result(ttse_result_event_e event, const void* data, unsigned int data_size, ttse_audio_type_e audio_type, int rate, void* user_data);
38 int ttsd_send_error(ttse_error_e error, const char* msg);
39
40 int ttsd_set_private_data_set_cb(ttse_private_data_set_cb callback);
41 int ttsd_set_private_data_requested_cb(ttse_private_data_requested_cb callback);
42
43 int ttsd_get_activated_mode(int* activated_mode);
44 int ttsd_set_activated_mode_changed_cb(ttse_activated_mode_changed_cb callback);
45
46 int ttsd_set_personal_tts_id_set_cb(ttse_set_personal_tts_id_cb callback);
47
48 int ttsd_send_personal_voice(const char* language, const char* unique_id, const char* display_name, const char* device_name, void* user_data);
49
50
51 /*
52 * Server API for client
53 */
54
55 int ttsd_server_is_already_initialized(int pid, unsigned int uid, bool* is_initialized);
56
57 int ttsd_server_initialize(int pid, unsigned int uid, ttsd_mode_e mode, ttsd_playing_mode_e playing_mode, int registered_event_mask, tts_ipc_method_e method, ttsd_state_e* service_state, bool* credential_needed);
58
59 int ttsd_server_finalize(unsigned int uid);
60
61 int ttsd_server_update_instant_reprepare_client();
62
63 int ttsd_server_get_support_voices(unsigned int uid, GList** voice_list);
64
65 int ttsd_server_get_current_voice(unsigned int uid, char** language, int* voice_type);
66
67 int ttsd_server_add_text(unsigned int uid, const char* text, const char* lang, int voice_type, int speed, int utt_id, const char* credential);
68
69 int ttsd_server_add_silent_utterance(unsigned int uid, unsigned int duration_in_msec, int utt_id, const char* credential);
70
71 int ttsd_server_add_text_with_synthesis_parameter(unsigned int uid, const char* text, const char* lang, const char* ptts_id, int voice_type, int speed, int pitch, double volume, double background_volume_ratio, int utt_id, const char* credential);
72
73 int ttsd_server_play(unsigned int uid, const char* credential);
74
75 int ttsd_server_stop(unsigned int uid);
76
77 int ttsd_server_pause(unsigned int uid);
78
79 int ttsd_server_set_private_data(unsigned int uid, const char* key, const char* data);
80
81 int ttsd_server_get_private_data(unsigned int uid, const char* key, char** data);
82
83 int ttsd_server_play_pcm(unsigned int uid);
84
85 int ttsd_server_add_pcm(unsigned int uid, int event, void* data, int data_size, int audio_type, int rate);
86
87 int ttsd_server_get_service_state(unsigned int uid, int* service_state);
88
89 #ifdef __cplusplus
90 }
91 #endif
92
93 #endif /* __TTSD_SERVER_CORE_H_ */