2 * Copyright (c) 2020 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.
18 #include "tts_client.h"
19 #include "tts_internal.h"
26 int tts_core_notify_state_changed(tts_client_s* client, tts_state_e current_state);
27 int tts_core_notify_utt_started(tts_client_s* client, int utt_id);
28 int tts_core_notify_utt_completeted(tts_client_s* client, int utt_id);
29 int tts_core_notify_error_async(tts_client_s* client, tts_error_e reason, int utt_id, const char* err_msg);
30 int tts_core_notify_default_voice_changed(tts_client_s* client, const char* before_lang, int before_voice_type, const char* language, int voice_type);
31 int tts_core_notify_engine_changed(tts_client_s* client, const char* engine_id, const char* language, int voice_type, bool need_credential);
32 int tts_core_notify_screen_reader_changed(tts_client_s* client, bool value);
33 int tts_core_notify_service_state_changed(tts_client_s* client, tts_service_state_e before_state, tts_service_state_e current_state);
34 int tts_core_notify_synthesized_pcm(tts_client_s* client, int utt_id, tts_synthesized_pcm_event_e event, const char* pcm_data, int pcm_data_size, tts_audio_type_e audio_type, int sample_rate);
36 bool tts_core_is_valid_text(const char* text);
37 bool tts_core_check_screen_reader(tts_client_s* client);
38 bool tts_core_check_credential(tts_client_s* client);
40 const char* tts_core_covert_error_code(tts_error_e err);
43 int tts_core_initialize();
44 int tts_core_deinitialize();
46 int tts_core_prepare(tts_client_s* client);
47 int tts_core_prepare_sync(tts_client_s* client);
48 int tts_core_unprepare(tts_client_s* client);
50 int tts_core_foreach_supported_voices(tts_client_s* client, const char* engine_id, tts_supported_voice_cb callback, void* user_data);
51 int tts_core_foreach_supported_personal_voices(tts_client_s* client, const char* engine_id, tts_supported_personal_voice_cb callback, void* user_data);
54 int tts_core_add_text(tts_client_s* client, const char* text, const char* language, int voice_type, int speed, int* utt_id);
55 int tts_core_add_silent_utterance(tts_client_s* client, unsigned int duration_in_msec, int* utt_id);
56 int tts_core_add_text_with_synthesis_parameter(tts_client_s* client, const char* text, tts_synthesis_parameter_h parameter, int* utt_id);
57 int tts_core_play(tts_client_s* client);
58 int tts_core_stop(tts_client_s* client);
59 int tts_core_pause(tts_client_s* client);
60 int tts_core_repeat(tts_client_s* client, char** text_repeat, int* utt_id);
62 int tts_core_add_pcm(tts_client_s* client, int event, const void* data, unsigned int data_size, int audio_type, int rate);
63 int tts_core_play_pcm(tts_client_s* client);
64 int tts_core_stop_pcm(tts_client_s* client);
66 int tts_core_set_private_data(tts_client_s* client, const char* key, const char* data);
67 int tts_core_get_private_data(tts_client_s* client, const char* key, char** data);
69 int tts_core_get_service_state(tts_client_s* client, tts_service_state_e* service_state);
71 int tts_core_receive_hello(unsigned int uid, int ret, tts_service_state_e service_state, int credential_needed);
72 int tts_core_handle_service_reset();
78 #endif /* __TTS_CORE_H_ */