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.
15 #include "ttsd_main.h"
16 #include "ttsd_dbus.h"
17 #include "ttsd_dbus_server.h"
18 #include "ttsd_server.h"
20 extern int ttsd_data_get_pid(const int uid);
23 * Dbus Client-Daemon Server
25 int ttsd_dbus_server_hello(DBusConnection* conn, DBusMessage* msg)
27 SLOG(LOG_DEBUG, tts_tag(), ">>>>> TTS Hello");
30 reply = dbus_message_new_method_return(msg);
33 if (!dbus_connection_send(conn, reply, NULL)) {
34 SLOG(LOG_ERROR, tts_tag(), "[OUT ERROR] Out Of Memory!");
37 dbus_connection_flush(conn);
38 dbus_message_unref(reply);
40 SLOG(LOG_ERROR, tts_tag(), "[OUT ERROR] Fail to create reply message!!");
46 int ttsd_dbus_server_initialize(DBusConnection* conn, DBusMessage* msg)
49 dbus_error_init(&err);
52 bool credential_needed = 0;
55 dbus_message_get_args(msg, &err,
56 DBUS_TYPE_INT32, &pid,
57 DBUS_TYPE_INT32, &uid,
60 SLOG(LOG_DEBUG, tts_tag(), ">>>>> TTS INITIALIZE");
62 if (dbus_error_is_set(&err)) {
63 SLOG(LOG_ERROR, tts_tag(), "[IN ERROR] tts initialize : get arguments error (%s)", err.message);
64 dbus_error_free(&err);
65 ret = TTSD_ERROR_OPERATION_FAILED;
68 SECURE_SLOG(LOG_DEBUG, tts_tag(), "[IN] tts initialize : pid(%d), uid(%d)", pid , uid);
69 ret = ttsd_server_initialize(pid, uid, &credential_needed);
73 reply = dbus_message_new_method_return(msg);
75 int temp = (int)credential_needed;
76 SLOG(LOG_DEBUG, tts_tag(), "[OUT] tts initialize : result(%d), credential_needed(%d)", ret, (int)credential_needed);
78 dbus_message_append_args(reply,
79 DBUS_TYPE_INT32, &ret,
80 DBUS_TYPE_INT32, &temp,
84 SLOG(LOG_DEBUG, tts_tag(), "[OUT] tts initialize : result(%d), credential_needed(%d)", ret, credential_needed);
86 SLOG(LOG_ERROR, tts_tag(), "[OUT ERROR] tts initialize : result(%d)", ret);
89 if (!dbus_connection_send(conn, reply, NULL)) {
90 SLOG(LOG_ERROR, tts_tag(), "[OUT ERROR] tts initialize : Out Of Memory!");
93 dbus_connection_flush(conn);
94 dbus_message_unref(reply);
96 SLOG(LOG_ERROR, tts_tag(), "[OUT ERROR] tts initialize : Fail to create reply message!!");
102 int ttsd_dbus_server_finalize(DBusConnection* conn, DBusMessage* msg)
105 dbus_error_init(&err);
110 dbus_message_get_args(msg, &err, DBUS_TYPE_INT32, &uid, DBUS_TYPE_INVALID);
112 SLOG(LOG_DEBUG, tts_tag(), ">>>>> TTS FINALIZE");
114 if (dbus_error_is_set(&err)) {
115 SLOG(LOG_ERROR, tts_tag(), "[IN ERROR] tts finalize : get arguments error (%s)", err.message);
116 dbus_error_free(&err);
117 ret = TTSD_ERROR_OPERATION_FAILED;
119 SECURE_SLOG(LOG_DEBUG, tts_tag(), "[IN] tts finalize : uid(%d)", uid);
120 ret = ttsd_server_finalize(uid);
124 reply = dbus_message_new_method_return(msg);
127 dbus_message_append_args(reply, DBUS_TYPE_INT32, &ret, DBUS_TYPE_INVALID);
130 SLOG(LOG_DEBUG, tts_tag(), "[OUT] tts finalize : result(%d)", ret);
132 SLOG(LOG_ERROR, tts_tag(), "[OUT ERROR] tts finalize : result(%d)", ret);
135 if (!dbus_connection_send(conn, reply, NULL)) {
136 SLOG(LOG_ERROR, tts_tag(), "[OUT ERROR] tts finalize : Out Of Memory!");
139 dbus_connection_flush(conn);
140 dbus_message_unref(reply);
142 SLOG(LOG_ERROR, tts_tag(), "[OUT ERROR] tts finalize : Fail to create reply message!!");
148 int ttsd_dbus_server_get_support_voices(DBusConnection* conn, DBusMessage* msg)
151 dbus_error_init(&err);
155 GList* voice_list = NULL;
157 dbus_message_get_args(msg, &err, DBUS_TYPE_INT32, &uid, DBUS_TYPE_INVALID);
159 SLOG(LOG_DEBUG, tts_tag(), ">>>>> TTS GET VOICES");
161 if (dbus_error_is_set(&err)) {
162 SLOG(LOG_ERROR, tts_tag(), "[IN ERROR] tts get supported voices : get arguments error (%s)", err.message);
163 dbus_error_free(&err);
164 ret = TTSD_ERROR_OPERATION_FAILED;
166 SECURE_SLOG(LOG_DEBUG, tts_tag(), "[IN] get supported voices : uid(%d)", uid);
167 ret = ttsd_server_get_support_voices(uid, &voice_list);
171 reply = dbus_message_new_method_return(msg);
174 DBusMessageIter args;
175 dbus_message_iter_init_append(reply, &args);
178 dbus_message_iter_append_basic(&args, DBUS_TYPE_INT32, &(ret));
181 /* Append voice size */
182 int size = g_list_length(voice_list);
184 if (!dbus_message_iter_append_basic(&args, DBUS_TYPE_INT32, &(size))) {
185 SLOG(LOG_ERROR, tts_tag(), "[OUT ERROR] tts supported voices : Fail to append type");
186 ret = TTSD_ERROR_OPERATION_FAILED;
192 iter = g_list_first(voice_list);
194 while (NULL != iter) {
198 dbus_message_iter_append_basic(&args, DBUS_TYPE_STRING, &(voice->language));
199 dbus_message_iter_append_basic(&args, DBUS_TYPE_INT32, &(voice->type));
201 if (NULL != voice->language)
202 g_free(voice->language);
207 voice_list = g_list_remove_link(voice_list, iter);
209 iter = g_list_first(voice_list);
212 SLOG(LOG_DEBUG, tts_tag(), "[OUT] tts supported voices : result(%d)", ret);
214 SLOG(LOG_ERROR, tts_tag(), "[OUT ERROR] tts supported voices : result(%d)", ret);
217 if (!dbus_connection_send(conn, reply, NULL)) {
218 SLOG(LOG_ERROR, tts_tag(), "[OUT ERROR] error : Out Of Memory!");
221 dbus_connection_flush(conn);
222 dbus_message_unref(reply);
224 SLOG(LOG_ERROR, tts_tag(), "[OUT ERROR] tts supported voices : Fail to create reply message!!");
230 int ttsd_dbus_server_get_current_voice(DBusConnection* conn, DBusMessage* msg)
233 dbus_error_init(&err);
240 dbus_message_get_args(msg, &err, DBUS_TYPE_INT32, &uid, DBUS_TYPE_INVALID);
242 SLOG(LOG_DEBUG, tts_tag(), ">>>>> TTS GET DEFAULT VOICE");
244 if (dbus_error_is_set(&err)) {
245 SLOG(LOG_ERROR, tts_tag(), "[IN ERROR] tts get default voice : Get arguments error (%s)", err.message);
246 dbus_error_free(&err);
247 ret = TTSD_ERROR_OPERATION_FAILED;
249 SECURE_SLOG(LOG_DEBUG, tts_tag(), "[IN] tts get default voice : uid(%d)", uid);
250 ret = ttsd_server_get_current_voice(uid, &lang, &voice_type);
254 reply = dbus_message_new_method_return(msg);
258 /* Append result and voice */
259 dbus_message_append_args(reply,
260 DBUS_TYPE_INT32, &ret,
261 DBUS_TYPE_STRING, &lang,
262 DBUS_TYPE_INT32, &voice_type,
264 SECURE_SLOG(LOG_DEBUG, tts_tag(), "[OUT] tts default voice : lang(%s), vctype(%d)", lang, voice_type);
266 dbus_message_append_args(reply,
267 DBUS_TYPE_INT32, &ret,
269 SLOG(LOG_ERROR, tts_tag(), "[OUT ERROR] tts default voice : result(%d)", ret);
272 if (!dbus_connection_send(conn, reply, NULL)) {
273 SLOG(LOG_ERROR, tts_tag(), "[OUT ERROR] tts default voice : Out Of Memory!");
276 dbus_connection_flush(conn);
277 dbus_message_unref(reply);
279 SLOG(LOG_ERROR, tts_tag(), "[OUT ERROR] tts default voice : Fail to create reply message!!");
282 if (NULL != lang) free(lang);
286 int ttsd_dbus_server_add_text(DBusConnection* conn, DBusMessage* msg)
289 dbus_error_init(&err);
291 int uid, voicetype, speed, uttid;
292 char *text, *lang, *credential;
295 dbus_message_get_args(msg, &err,
296 DBUS_TYPE_INT32, &uid,
297 DBUS_TYPE_STRING, &text,
298 DBUS_TYPE_STRING, &lang,
299 DBUS_TYPE_INT32, &voicetype,
300 DBUS_TYPE_INT32, &speed,
301 DBUS_TYPE_INT32, &uttid,
302 DBUS_TYPE_STRING, &credential,
305 SLOG(LOG_DEBUG, tts_tag(), ">>>>> TTS ADD TEXT");
307 if (dbus_error_is_set(&err)) {
308 SLOG(LOG_ERROR, tts_tag(), "[IN ERROR] tts add text : Get arguments error (%s)", err.message);
309 dbus_error_free(&err);
310 ret = TTSD_ERROR_OPERATION_FAILED;
313 SECURE_SLOG(LOG_DEBUG, tts_tag(), "[IN] tts add text : uid(%d), text(%s), lang(%s), type(%d), speed(%d), uttid(%d), credential(%s)",
314 uid, (NULL == text) ? "NULL" : text, (NULL == lang) ? "NULL" : lang, voicetype, speed, uttid, (NULL == credential) ? "NULL" : credential);
315 ret = ttsd_server_add_queue(uid, text, lang, voicetype, speed, uttid, credential);
319 reply = dbus_message_new_method_return(msg);
322 dbus_message_append_args(reply, DBUS_TYPE_INT32, &ret, DBUS_TYPE_INVALID);
325 SLOG(LOG_DEBUG, tts_tag(), "[OUT] tts add text : result(%d)", ret);
327 SLOG(LOG_ERROR, tts_tag(), "[OUT ERROR] tts add text : result(%d)", ret);
330 if (!dbus_connection_send(conn, reply, NULL)) {
331 SLOG(LOG_ERROR, tts_tag(), "[OUT ERROR] tts add text : Out Of Memory!");
334 dbus_connection_flush(conn);
335 dbus_message_unref(reply);
337 SLOG(LOG_ERROR, tts_tag(), "[OUT ERROR] tts add text : Fail to create reply message!!");
340 SLOG(LOG_DEBUG, tts_tag(), "<<<<<");
341 SLOG(LOG_DEBUG, tts_tag(), " ");
346 int ttsd_dbus_server_play(DBusConnection* conn, DBusMessage* msg)
349 dbus_error_init(&err);
355 dbus_message_get_args(msg, &err,
356 DBUS_TYPE_INT32, &uid,
357 DBUS_TYPE_STRING, &credential,
360 SLOG(LOG_DEBUG, tts_tag(), ">>>>> TTS PLAY");
362 if (dbus_error_is_set(&err)) {
363 SLOG(LOG_ERROR, tts_tag(), "[IN ERROR] tts play : Get arguments error (%s)", err.message);
364 dbus_error_free(&err);
365 ret = TTSD_ERROR_OPERATION_FAILED;
367 SECURE_SLOG(LOG_DEBUG, tts_tag(), "[IN] tts play : uid(%d), credential(%s)", uid, (NULL == credential) ? "NULL" : credential);
368 ret = ttsd_server_play(uid, credential);
372 reply = dbus_message_new_method_return(msg);
375 dbus_message_append_args(reply, DBUS_TYPE_INT32, &ret, DBUS_TYPE_INVALID);
378 SLOG(LOG_DEBUG, tts_tag(), "[OUT] tts play : result(%d)", ret);
380 SLOG(LOG_ERROR, tts_tag(), "[OUT ERROR] tts play : result(%d)", ret);
383 if (!dbus_connection_send(conn, reply, NULL)) {
384 SLOG(LOG_ERROR, tts_tag(), "[OUT ERROR] tts play : Out Of Memory!");
387 dbus_connection_flush(conn);
388 dbus_message_unref(reply);
390 SLOG(LOG_ERROR, tts_tag(), "[OUT ERROR] tts play : Fail to create reply message!!");
393 SLOG(LOG_DEBUG, tts_tag(), "<<<<<");
394 SLOG(LOG_DEBUG, tts_tag(), " ");
399 int ttsd_dbus_server_stop(DBusConnection* conn, DBusMessage* msg)
402 dbus_error_init(&err);
406 dbus_message_get_args(msg, &err,
407 DBUS_TYPE_INT32, &uid,
410 SLOG(LOG_DEBUG, tts_tag(), ">>>>> TTS STOP");
412 if (dbus_error_is_set(&err)) {
413 SLOG(LOG_ERROR, tts_tag(), "[IN ERROR] tts stop : Get arguments error (%s)", err.message);
414 dbus_error_free(&err);
415 ret = TTSD_ERROR_OPERATION_FAILED;
417 SECURE_SLOG(LOG_DEBUG, tts_tag(), "[IN] tts stop : uid(%d)", uid);
418 ret = ttsd_server_stop(uid);
422 reply = dbus_message_new_method_return(msg);
425 dbus_message_append_args(reply,
426 DBUS_TYPE_INT32, &ret,
430 SLOG(LOG_DEBUG, tts_tag(), "[OUT] tts stop : result(%d)", ret);
432 SLOG(LOG_ERROR, tts_tag(), "[OUT ERROR] tts stop : result(%d)", ret);
435 if (!dbus_connection_send(conn, reply, NULL)) {
436 SLOG(LOG_ERROR, tts_tag(), "[OUT ERROR] tts stop : Out Of Memory!");
439 dbus_connection_flush(conn);
440 dbus_message_unref(reply);
442 SLOG(LOG_ERROR, tts_tag(), "[OUT ERROR] tts stop : Fail to create reply message!!");
445 SLOG(LOG_DEBUG, tts_tag(), "<<<<<");
446 SLOG(LOG_DEBUG, tts_tag(), " ");
451 int ttsd_dbus_server_pause(DBusConnection* conn, DBusMessage* msg)
454 dbus_error_init(&err);
459 dbus_message_get_args(msg, &err,
460 DBUS_TYPE_INT32, &uid,
463 SLOG(LOG_DEBUG, tts_tag(), ">>>>> TTS PAUSE");
465 if (dbus_error_is_set(&err)) {
466 SLOG(LOG_ERROR, tts_tag(), "[IN ERROR] tts pause : Get arguments error (%s)", err.message);
467 dbus_error_free(&err);
468 ret = TTSD_ERROR_OPERATION_FAILED;
470 SECURE_SLOG(LOG_DEBUG, tts_tag(), "[IN] tts pause : uid(%d)", uid);
471 ret = ttsd_server_pause(uid, &uttid);
475 reply = dbus_message_new_method_return(msg);
478 dbus_message_append_args(reply,
479 DBUS_TYPE_INT32, &ret,
483 SLOG(LOG_DEBUG, tts_tag(), "[OUT] tts pause : result(%d)", ret);
485 SLOG(LOG_ERROR, tts_tag(), "[OUT ERROR] tts pause : result(%d)", ret);
488 if (!dbus_connection_send(conn, reply, NULL)) {
489 SLOG(LOG_ERROR, tts_tag(), "[OUT ERROR] tts pause : Out Of Memory!");
492 dbus_connection_flush(conn);
493 dbus_message_unref(reply);
495 SLOG(LOG_ERROR, tts_tag(), "[OUT ERROR] tts pause : Fail to create reply message!!");
498 SLOG(LOG_DEBUG, tts_tag(), "<<<<<");
499 SLOG(LOG_DEBUG, tts_tag(), " ");
504 int ttsd_dbus_server_set_private_data(DBusConnection* conn, DBusMessage* msg)
507 dbus_error_init(&err);
513 dbus_message_get_args(msg, &err,
514 DBUS_TYPE_INT32, &uid,
515 DBUS_TYPE_STRING, &key,
516 DBUS_TYPE_STRING, &data,
519 SLOG(LOG_DEBUG, tts_tag(), ">>>>> TTS set private data");
521 if (dbus_error_is_set(&err)) {
522 SLOG(LOG_ERROR, tts_tag(), "[IN ERROR] Fail to get arguments (%s)", err.message);
523 dbus_error_free(&err);
524 ret = TTSD_ERROR_OPERATION_FAILED;
526 SLOG(LOG_DEBUG, tts_tag(), "[IN] tts set private data(%d)", uid);
527 ret = ttsd_server_set_private_data(uid, key, data);
531 reply = dbus_message_new_method_return(msg);
534 dbus_message_append_args(reply,
535 DBUS_TYPE_INT32, &ret,
539 SLOG(LOG_DEBUG, tts_tag(), "[OUT] tts set private data : (%d)", ret);
541 SLOG(LOG_ERROR, tts_tag(), "[OUT ERROR] tts set private data : (%d)", ret);
544 if (!dbus_connection_send(conn, reply, NULL)) {
545 SLOG(LOG_ERROR, tts_tag(), "[OUT ERROR] Fail to send reply");
548 dbus_connection_flush(conn);
549 dbus_message_unref(reply);
551 SLOG(LOG_ERROR, tts_tag(), "[OUT ERROR] Fail to create reply message");
554 SLOG(LOG_DEBUG, tts_tag(), "<<<<<");
555 SLOG(LOG_DEBUG, tts_tag(), "");
560 int ttsd_dbus_server_get_private_data(DBusConnection* conn, DBusMessage* msg)
563 dbus_error_init(&err);
569 dbus_message_get_args(msg, &err,
570 DBUS_TYPE_INT32, &uid,
571 DBUS_TYPE_STRING, &key,
574 SLOG(LOG_DEBUG, tts_tag(), ">>>>> TTS get private data");
576 if (dbus_error_is_set(&err)) {
577 SLOG(LOG_ERROR, tts_tag(), "[IN ERROR] Fail to get arguments (%s)", err.message);
578 dbus_error_free(&err);
579 ret = TTSD_ERROR_OPERATION_FAILED;
581 SLOG(LOG_DEBUG, tts_tag(), "[IN] tts get private data(%d)", uid);
582 ret = ttsd_server_get_private_data(uid, key, &data);
586 reply = dbus_message_new_method_return(msg);
589 dbus_message_append_args(reply,
590 DBUS_TYPE_INT32, &ret,
591 DBUS_TYPE_STRING, &data,
595 SLOG(LOG_DEBUG, tts_tag(), "[OUT] tts get private data : Result(%d), data(%s)", ret, (NULL == data) ? "NULL" : data);
597 SLOG(LOG_ERROR, tts_tag(), "[OUT ERROR] tts get private data : (%d)", ret);
600 if (!dbus_connection_send(conn, reply, NULL)) {
601 SLOG(LOG_ERROR, tts_tag(), "[OUT ERROR] Fail to send reply");
604 dbus_connection_flush(conn);
605 dbus_message_unref(reply);
607 SLOG(LOG_ERROR, tts_tag(), "[OUT ERROR] Fail to create reply message");
610 SLOG(LOG_DEBUG, tts_tag(), "<<<<<");
611 SLOG(LOG_DEBUG, tts_tag(), "");
621 int ttsd_dbus_server_play_pcm(DBusConnection* conn, DBusMessage* msg)
624 dbus_error_init(&err);
629 dbus_message_get_args(msg, &err,
630 DBUS_TYPE_INT32, &uid,
633 SLOG(LOG_DEBUG, tts_tag(), ">>>>> TTS PLAY PCM");
635 if (dbus_error_is_set(&err)) {
636 SLOG(LOG_ERROR, tts_tag(), "[IN ERROR] tts play pcm : Get arguments error (%s)", err.message);
637 dbus_error_free(&err);
638 ret = TTSD_ERROR_OPERATION_FAILED;
640 SECURE_SLOG(LOG_DEBUG, tts_tag(), "[IN] tts play pcm : uid(%d)", uid);
641 ret = ttsd_server_play_pcm(uid);
645 reply = dbus_message_new_method_return(msg);
648 dbus_message_append_args(reply, DBUS_TYPE_INT32, &ret, DBUS_TYPE_INVALID);
651 SLOG(LOG_DEBUG, tts_tag(), "[OUT] tts play pcm : result(%d)", ret);
653 SLOG(LOG_ERROR, tts_tag(), "[OUT ERROR] tts play pcm : result(%d)", ret);
656 if (!dbus_connection_send(conn, reply, NULL)) {
657 SLOG(LOG_ERROR, tts_tag(), "[OUT ERROR] tts play pcm : Out Of Memory!");
660 dbus_connection_flush(conn);
661 dbus_message_unref(reply);
663 SLOG(LOG_ERROR, tts_tag(), "[OUT ERROR] tts play pcm : Fail to create reply message!!");
666 SLOG(LOG_DEBUG, tts_tag(), "<<<<<");
667 SLOG(LOG_DEBUG, tts_tag(), " ");
672 int ttsd_dbus_server_stop_pcm(DBusConnection* conn, DBusMessage* msg)
675 dbus_error_init(&err);
680 dbus_message_get_args(msg, &err,
681 DBUS_TYPE_INT32, &uid,
684 SLOG(LOG_DEBUG, tts_tag(), ">>>>> TTS STOP PCM");
686 if (dbus_error_is_set(&err)) {
687 SLOG(LOG_ERROR, tts_tag(), "[IN ERROR] tts stop pcm : Get arguments error (%s)", err.message);
688 dbus_error_free(&err);
689 ret = TTSD_ERROR_OPERATION_FAILED;
691 SECURE_SLOG(LOG_DEBUG, tts_tag(), "[IN] tts stop pcm : uid(%d)", uid);
692 ret = ttsd_server_stop_pcm(uid);
696 reply = dbus_message_new_method_return(msg);
699 dbus_message_append_args(reply, DBUS_TYPE_INT32, &ret, DBUS_TYPE_INVALID);
702 SLOG(LOG_DEBUG, tts_tag(), "[OUT] tts stop pcm : result(%d)", ret);
704 SLOG(LOG_ERROR, tts_tag(), "[OUT ERROR] tts stop pcm : result(%d)", ret);
707 if (!dbus_connection_send(conn, reply, NULL)) {
708 SLOG(LOG_ERROR, tts_tag(), "[OUT ERROR] tts stop pcm : Out Of Memory!");
711 dbus_connection_flush(conn);
712 dbus_message_unref(reply);
714 SLOG(LOG_ERROR, tts_tag(), "[OUT ERROR] tts stop pcm : Fail to create reply message!!");
717 SLOG(LOG_DEBUG, tts_tag(), "<<<<<");
718 SLOG(LOG_DEBUG, tts_tag(), " ");
723 int ttsd_dbus_server_add_pcm(DBusConnection* conn, DBusMessage* msg)
726 dbus_error_init(&err);
736 dbus_message_get_args(msg, &err,
737 DBUS_TYPE_INT32, &uid,
738 DBUS_TYPE_INT32, &event,
739 DBUS_TYPE_INT32, &audio_type,
740 DBUS_TYPE_INT32, &rate,
741 //DBUS_TYPE_STRING, &data,
742 //DBUS_TYPE_INT32, &data_size,
743 DBUS_TYPE_ARRAY, DBUS_TYPE_BYTE,
747 SLOG(LOG_DEBUG, tts_tag(), ">>>>> TTS ADD PCM");
749 if (dbus_error_is_set(&err)) {
750 SLOG(LOG_ERROR, tts_tag(), "[IN ERROR] tts add pcm : Get arguments error (%s)", err.message);
751 dbus_error_free(&err);
752 ret = TTSD_ERROR_OPERATION_FAILED;
754 SECURE_SLOG(LOG_DEBUG, tts_tag(), "[IN] tts add pcm : uid(%d)", uid);
755 ret = ttsd_server_add_pcm(uid, event, (void*)data, data_size, audio_type, rate);
759 reply = dbus_message_new_method_return(msg);
762 dbus_message_append_args(reply, DBUS_TYPE_INT32, &ret, DBUS_TYPE_INVALID);
765 SLOG(LOG_DEBUG, tts_tag(), "[OUT] tts add pcm : result(%d)", ret);
767 SLOG(LOG_ERROR, tts_tag(), "[OUT ERROR] tts add pcm : result(%d)", ret);
770 if (!dbus_connection_send(conn, reply, NULL)) {
771 SLOG(LOG_ERROR, tts_tag(), "[OUT ERROR] tts add pcm : Out Of Memory!");
774 dbus_connection_flush(conn);
775 dbus_message_unref(reply);
777 SLOG(LOG_ERROR, tts_tag(), "[OUT ERROR] tts add pcm : Fail to create reply message!!");
780 SLOG(LOG_DEBUG, tts_tag(), "<<<<<");
781 SLOG(LOG_DEBUG, tts_tag(), " ");