mobile-lua: add additional LABELLED_BY relation
[profile/tv/apps/native/screen-reader.git] / src / screen_reader_system.c
1 /*
2  * Copyright (c) 2015 Samsung Electronics Co., Ltd. All rights reserved.
3  *
4  * Licensed under the Flora License, Version 1.1 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *     http://floralicense.org/license/
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 #ifndef SCREEN_READER_TV
18
19 #define _GNU_SOURCE
20
21 #include <device/battery.h>
22 #include <device/display.h>
23 #include <device/callback.h>
24 #include <bluetooth.h>
25 #include <tapi_common.h>
26 #include <TelNetwork.h>
27 #include <vconf.h>
28 #include <wifi.h>
29 #include <notification.h>
30 #include <notification_list.h>
31
32 #include "screen_reader.h"
33 #include "screen_reader_tts.h"
34 #include "smart_notification.h"
35 #include "logger.h"
36
37 #define MAX_SIM_COUNT 2
38 #define DATE_TIME_BUFFER_SIZE 26
39
40 TapiHandle *tapi_handle[MAX_SIM_COUNT + 1] = { 0, };
41
42 static void device_system_cb(device_callback_e type, void *value, void *user_data);
43
44 static void tapi_init(void)
45 {
46         int i = 0;
47         char **cp_list = tel_get_cp_name_list();
48
49         if (!cp_list) {
50                 ERROR("cp name list is null");
51                 return;
52         }
53
54         DEBUG("TAPI INIT");
55         for (i = 0; cp_list[i]; ++i) {
56                 tapi_handle[i] = tel_init(cp_list[i]);
57                 DEBUG("CP_LIST %d = %s", i, cp_list[i]);
58         }
59
60 }
61
62 /**
63  * @brief Initializer for smart notifications
64  *
65  */
66 void system_notifications_init(void)
67 {
68         DEBUG("******************** START ********************");
69         int ret = -1;
70
71         // BATTERY LOW/FULL
72         device_add_callback(DEVICE_CALLBACK_BATTERY_LEVEL, device_system_cb, NULL);
73         // BATTERY CHARGING/NOT-CHARGING
74         device_add_callback(DEVICE_CALLBACK_BATTERY_CHARGING, device_system_cb, NULL);
75         // SCREEN OFF/ON
76         device_add_callback(DEVICE_CALLBACK_DISPLAY_STATE, device_system_cb, NULL);
77
78         ret = bt_initialize();
79         if (ret != BT_ERROR_NONE) {
80                 ERROR("ret == %d", ret);
81         }
82
83         ret = wifi_initialize();
84         if (ret != WIFI_ERROR_NONE) {
85                 ERROR("ret == %d", ret);
86         }
87
88         tapi_init();
89
90         DEBUG(" ********************* END ********************* ");
91 }
92
93 /**
94  * @brief Initializer for smart notifications
95  *
96  */
97 void system_notifications_shutdown(void)
98 {
99         int ret = -1;
100
101         // BATTERY LOW/FULL
102         device_remove_callback(DEVICE_CALLBACK_BATTERY_LEVEL, device_system_cb);
103         // BATTERY CHARGING/NOT-CHARGING
104         device_remove_callback(DEVICE_CALLBACK_BATTERY_CHARGING, device_system_cb);
105         // SCREEN OFF/ON
106         device_remove_callback(DEVICE_CALLBACK_DISPLAY_STATE, device_system_cb);
107
108         ret = bt_deinitialize();
109         if (ret != BT_ERROR_NONE) {
110                 ERROR("ret == %d", ret);
111         }
112
113         ret = wifi_deinitialize();
114         if (ret != WIFI_ERROR_NONE) {
115                 ERROR("ret == %d", ret);
116                 return;
117         }
118 }
119
120 /**
121  * @brief Device system callback handler
122  *
123  * @param type Device callback type
124  * @param value UNUSED
125  * @param user_data UNUSED
126  */
127 static void device_system_cb(device_callback_e type, void *value, void *user_data)
128 {
129         if (type == DEVICE_CALLBACK_BATTERY_LEVEL) {
130                 device_battery_level_e status;
131                 if (device_battery_get_level_status(&status)) {
132                         ERROR("Cannot get battery level status");
133                         return;
134                 }
135
136                 if (status == DEVICE_BATTERY_LEVEL_LOW) {
137                         tts_speak(_("IDS_SYSTEM_BATTERY_LOW"), EINA_TRUE);
138                 } else if (status == DEVICE_BATTERY_LEVEL_CRITICAL) {
139                         tts_speak(_("IDS_SYSTEM_BATTERY_CRITICAL"), EINA_TRUE);
140                 } else if (status == DEVICE_BATTERY_LEVEL_FULL) {
141                         tts_speak(_("IDS_SYSTEM_BATTERY_FULL"), EINA_TRUE);
142                 }
143         } else if (type == DEVICE_CALLBACK_BATTERY_CHARGING) {
144                 bool charging;
145                 if (device_battery_is_charging(&charging)) {
146                         ERROR("Cannot check if battery is charging");
147                         return;
148                 }
149
150                 if (!charging)
151                         tts_speak(_("IDS_SYSTEM_NOT_CHARGING"), EINA_FALSE);
152         } else if (type == DEVICE_CALLBACK_DISPLAY_STATE) {
153                 display_state_e state;
154                 if (device_display_get_state(&state)) {
155                         ERROR("Cannot check if battery is charging");
156                         return;
157                 }
158
159                 if (state == DISPLAY_STATE_NORMAL) {
160                         tts_speak(_("IDS_SYSTEM_SCREEN_ON"), EINA_FALSE);
161                 } else if (state == DISPLAY_STATE_SCREEN_OFF) {
162                         tts_speak(_("IDS_SYSTEM_SCREEN_OFF"), EINA_FALSE);
163                 }
164         }
165 }
166
167 // ******************************** Indicator info ********************************** //
168
169 static int _read_text_get(char *key)
170 {
171         int read_text = 0;
172         int ret = -1;
173
174         ret = vconf_get_bool(key, &read_text);
175         if (ret != 0) {
176                 ERROR("ret == %d", ret);
177                 return true;
178         }
179
180         return read_text;
181 }
182
183 void device_time_get(void)
184 {
185         char buffer[DATE_TIME_BUFFER_SIZE];
186         int disp_12_24 = VCONFKEY_TIME_FORMAT_12;
187         int ret = -1;
188         time_t rawtime = 0;
189         struct tm *timeinfo = NULL;
190
191         if (!_read_text_get(VCONFKEY_SETAPPL_ACCESSIBILITY_TTS_INDICATOR_INFORMATION_TIME)) {
192                 return;
193         }
194
195         time(&rawtime);
196         timeinfo = localtime(&rawtime);
197         if (!timeinfo) {
198                 ERROR("localtime returns NULL");
199                 return;
200         }
201
202         ret = vconf_get_int(VCONFKEY_REGIONFORMAT_TIME1224, &disp_12_24);
203         if (ret != 0) {
204                 ERROR("ret == %d", ret);
205         }
206
207         if (disp_12_24 == VCONFKEY_TIME_FORMAT_24) {
208                 strftime(buffer, DATE_TIME_BUFFER_SIZE, "Current time: %H %M", timeinfo);
209         } else {
210                 strftime(buffer, DATE_TIME_BUFFER_SIZE, "Current time: %I %M %p", timeinfo);
211         }
212
213         DEBUG("Text to say: %s", buffer);
214         tts_speak(buffer, EINA_FALSE);
215 }
216
217 char *device_error_to_string(int e)
218 {
219         switch (e) {
220         case DEVICE_ERROR_NONE:
221                 return "DEVICE_ERROR_NONE";
222                 break;
223
224         case DEVICE_ERROR_OPERATION_FAILED:
225                 return "DEVICE_ERROR_OPERATION_FAILED";
226                 break;
227
228         case DEVICE_ERROR_PERMISSION_DENIED:
229                 return "DEVICE_ERROR_PERMISSION_DENIED";
230                 break;
231
232         case DEVICE_ERROR_INVALID_PARAMETER:
233                 return "DEVICE_ERROR_INVALID_PARAMETER";
234                 break;
235
236         case DEVICE_ERROR_ALREADY_IN_PROGRESS:
237                 return "DEVICE_ERROR_ALREADY_IN_PROGRESS";
238                 break;
239
240         case DEVICE_ERROR_NOT_SUPPORTED:
241                 return "DEVICE_ERROR_NOT_SUPPORTED";
242                 break;
243
244         case DEVICE_ERROR_RESOURCE_BUSY:
245                 return "DEVICE_ERROR_RESOURCE_BUSY";
246                 break;
247
248         case DEVICE_ERROR_NOT_INITIALIZED:
249                 return "DEVICE_ERROR_NOT_INITIALIZED";
250                 break;
251
252         default:
253                 return _("IDS_SYSTEM_NETWORK_SERVICE_UNKNOWN");
254                 break;
255         }
256 }
257
258 void device_battery_get(void)
259 {
260         char *buffer = NULL;
261         char *charging_text = NULL;
262         int percent;
263         bool is_charging = false;
264         int ret = -1;
265
266         if (!_read_text_get(VCONFKEY_SETAPPL_ACCESSIBILITY_TTS_INDICATOR_INFORMATION_BATTERY)) {
267                 return;
268         }
269
270         ret = device_battery_is_charging(&is_charging);
271         if (ret != DEVICE_ERROR_NONE) {
272                 ERROR("ret == %s", device_error_to_string(ret));
273         }
274
275         if (is_charging) {
276                 charging_text = _("IDS_SYSTEM_BATTERY_INFO_CHARGING");
277         } else {
278                 charging_text = "";
279         }
280
281         ret = device_battery_get_percent(&percent);
282         if (ret != DEVICE_ERROR_NONE) {
283                 ERROR("ret == %s", device_error_to_string(ret));
284                 return;
285         }
286
287         if (percent == 100) {
288                 ret = asprintf(&buffer, "%s %s", charging_text, _("IDS_SYSTEM_BATTERY_FULLY_CHARGED_STR"));
289                 if (ret == 0) {
290                         free(buffer);
291                         ERROR("Buffer length == 0");
292                         return;
293                 } else if (ret < 0) {
294                         ERROR("Buffer == NULL");
295                         return;
296                 }
297         } else {
298                 ret = asprintf(&buffer, "%s %d %% %s", charging_text, percent, _("IDS_SYSTEM_BATTERY_INFO_BATTERY_STR"));
299                 if (ret == 0) {
300                         free(buffer);
301                         ERROR("Buffer length == 0");
302                         return;
303                 } else if(ret < 0) {
304                         ERROR("Buffer == NULL");
305                         return;
306                 }
307         }
308
309         if (!buffer) {
310                 ERROR("buf == NULL");
311                 return;
312         }
313
314         DEBUG("Text to say: %s", buffer);
315         tts_speak(buffer, EINA_FALSE);
316         free(buffer);
317 }
318
319 static void _signal_strength_sim_get(void)
320 {
321         int i = 0;
322         int val = 0;
323         int ret = -1;
324         int sim_card_count = 0;
325         Eina_Strbuf *str_buf = NULL;
326         char *buffer = NULL;
327         int service_type = TAPI_NETWORK_SERVICE_TYPE_UNKNOWN;
328         char *service_type_text = NULL;
329
330         str_buf = eina_strbuf_new();
331
332         for (i = 0; tapi_handle[i]; ++i) {
333                 ++sim_card_count;
334         }
335
336         for (i = 0; tapi_handle[i]; ++i) {
337                 ret = tel_get_property_int(tapi_handle[i], TAPI_PROP_NETWORK_SIGNALSTRENGTH_LEVEL, &val);
338                 if (ret != TAPI_API_SUCCESS) {
339                         ERROR("Can not get %s", TAPI_PROP_NETWORK_SIGNALSTRENGTH_LEVEL);
340                         val = 0;
341                 }
342
343                 if (sim_card_count > 1)
344                         eina_strbuf_append_printf(str_buf, "%s %d %s %d; ", _("IDS_SYSTEM_SIGNAL_SIMCARD"), i + 1, _("IDS_SYSTEM_SIGNAL_STRENGTH"), val);
345                 else
346                         eina_strbuf_append_printf(str_buf, "%s %d; ", _("IDS_SYSTEM_SIGNAL_STRENGTH"), val);
347                 DEBUG("sim: %d TAPI_PROP_NETWORK_SIGNALSTRENGTH_LEVEL %d", i, val);
348
349                 ret = tel_get_property_int(tapi_handle[i], TAPI_PROP_NETWORK_SERVICE_TYPE, &service_type);
350                 if (ret != TAPI_API_SUCCESS) {
351                         ERROR("Can not get %s", TAPI_PROP_NETWORK_SERVICE_TYPE);
352                 }
353
354                 switch (service_type) {
355                 case TAPI_NETWORK_SERVICE_TYPE_UNKNOWN:
356                         service_type_text = _("IDS_SYSTEM_NETWORK_SERVICE_UNKNOWN");
357                         break;
358
359                 case TAPI_NETWORK_SERVICE_TYPE_NO_SERVICE:
360                         service_type_text = _("IDS_SYSTEM_NETWORK_SERVICE_NO_SERVICE");
361                         break;
362
363                 case TAPI_NETWORK_SERVICE_TYPE_EMERGENCY:
364                         service_type_text = _("IDS_SYSTEM_NETWORK_SERVICE_EMERGENCY");
365                         break;
366
367                 case TAPI_NETWORK_SERVICE_TYPE_SEARCH:
368                         service_type_text = _("IDS_SYSTEM_NETWORK_SERVICE_SEARCHING");
369                         break;
370
371                 case TAPI_NETWORK_SERVICE_TYPE_2G:
372                         service_type_text = _("IDS_SYSTEM_NETWORK_SERVICE_2G");
373                         break;
374
375                 case TAPI_NETWORK_SERVICE_TYPE_2_5G:
376                         service_type_text = _("IDS_SYSTEM_NETWORK_SERVICE_25G");
377                         break;
378
379                 case TAPI_NETWORK_SERVICE_TYPE_2_5G_EDGE:
380                         service_type_text = _("IDS_SYSTEM_NETWORK_SERVICE_EDGE");
381                         break;
382
383                 case TAPI_NETWORK_SERVICE_TYPE_3G:
384                         service_type_text = _("IDS_SYSTEM_NETWORK_SERVICE_3G");
385                         break;
386
387                 case TAPI_NETWORK_SERVICE_TYPE_HSDPA:
388                         service_type_text = _("IDS_SYSTEM_NETWORK_SERVICE_HSDPA");
389                         break;
390
391                 case TAPI_NETWORK_SERVICE_TYPE_LTE:
392                         service_type_text = _("IDS_SYSTEM_NETWORK_SERVICE_LTE");
393                         break;
394                 }
395
396                 eina_strbuf_append_printf(str_buf, " Service type: %s.", service_type_text);
397         }
398
399         buffer = eina_strbuf_string_steal(str_buf);
400
401         DEBUG("Text to say: %s", buffer);
402         tts_speak(buffer, EINA_FALSE);
403
404         eina_strbuf_string_free(str_buf);
405         free(buffer);
406 }
407
408 static void _signal_strength_wifi_get(void)
409 {
410         int val = 0;
411         int ret = -1;
412         char *buffer = NULL;
413         char *wifi_text = NULL;
414         bool wifi_activated = false;
415         wifi_ap_h ap = NULL;
416
417         ret = wifi_is_activated(&wifi_activated);
418         if (ret != WIFI_ERROR_NONE) {
419                 ERROR("ret == %d", ret);
420                 return;
421         }
422
423         if (wifi_activated) {
424                 ret = wifi_get_connected_ap(&ap);
425                 if (ret != WIFI_ERROR_NONE) {
426                         ERROR("ret == %d", ret);
427                         return;
428                 }
429
430                 if (!ap) {
431                         DEBUG("Text to say: %s %s", _("IDS_SYSTEM_NETWORK_TYPE_WIFI"), "Not connected");
432
433                         ret = asprintf(&buffer, " %s, %s", _("IDS_SYSTEM_NETWORK_TYPE_WIFI"), "Not connected");
434                         if (ret == 0) {
435                                 free(buffer);
436                                 ERROR("Buffer length == 0");
437                                 return;
438                         } else if (ret < 0) {
439                                 ERROR("Buffer == NULL");
440                                 return;
441                         }
442
443                         tts_speak(buffer, EINA_FALSE);
444                         free(buffer);
445                         return;
446                 }
447
448                 ret = wifi_ap_get_rssi(ap, &val);
449                 if (ret != WIFI_ERROR_NONE) {
450                         ERROR("ret == %d", ret);
451                         wifi_ap_destroy(ap);
452                         return;
453                 }
454
455                 switch (val) {
456                 case 0:
457                         wifi_text = _("IDS_SYSTEM_WIFI_SIGNAL_NO_SIGNAL");
458                         break;
459
460                 case 1:
461                         wifi_text = _("IDS_SYSTEM_WIFI_SIGNAL_POOR");
462                         break;
463
464                 case 2:
465                         wifi_text = _("IDS_SYSTEM_WIFI_SIGNAL_WEAK");
466                         break;
467
468                 case 3:
469                         wifi_text = _("IDS_SYSTEM_WIFI_SIGNAL_MEDIUM");
470                         break;
471
472                 case 4:
473                         wifi_text = _("IDS_SYSTEM_WIFI_SIGNAL_GOOD");
474                         break;
475                 }
476
477                 if (!asprintf(&buffer, " %s, %s", _("IDS_SYSTEM_NETWORK_TYPE_WIFI"), wifi_text)) {
478                         ERROR("buffer length == 0");
479                         wifi_ap_destroy(ap);
480                         return;
481                 }
482
483                 DEBUG("Text to say: %s", buffer);
484                 tts_speak(buffer, EINA_FALSE);
485                 free(buffer);
486                 wifi_ap_destroy(ap);
487         }
488 }
489
490 void device_signal_strenght_get(void)
491 {
492         if (!_read_text_get(VCONFKEY_SETAPPL_ACCESSIBILITY_TTS_INDICATOR_INFORMATION_SIGNAL_STRENGHT)) {
493                 return;
494         }
495         _signal_strength_sim_get();
496         _signal_strength_wifi_get();
497 }
498
499 void device_missed_events_get(void)
500 {
501         notification_list_h list = NULL;
502         notification_list_h elem = NULL;
503         notification_h noti = NULL;
504         int ret = -1;
505         char *noti_count_text = NULL;
506         int noti_count = 0;
507         int current_noti_count = 0;
508         char *buffer = NULL;
509
510         if (!_read_text_get(VCONFKEY_SETAPPL_ACCESSIBILITY_TTS_INDICATOR_INFORMATION_MISSED_EVENTS)) {
511                 return;
512         }
513
514         ret = notification_get_list(NOTIFICATION_TYPE_NONE, -1, &list);
515         if (ret != NOTIFICATION_ERROR_NONE) {
516                 ERROR("ret == %d", ret);
517                 return;
518         }
519
520         elem = notification_list_get_head(list);
521
522         while (elem) {
523                 noti = notification_list_get_data(elem);
524                 notification_get_text(noti, NOTIFICATION_TEXT_TYPE_EVENT_COUNT, &noti_count_text);
525
526                 if (noti_count_text) {
527                         current_noti_count = atoi(noti_count_text);
528                         if (current_noti_count > 0) {
529                                 noti_count += current_noti_count;
530                         } else {
531                                 noti_count++;
532                         }
533                 } else {
534                         noti_count++;
535                 }
536
537                 elem = notification_list_get_next(elem);
538         }
539
540         if (noti_count == 0) {
541                 tts_speak(_("IDS_SYSTEM_NOTIFICATIONS_UNREAD_0"), EINA_FALSE);
542         } else if (noti_count == 1) {
543                 tts_speak(_("IDS_SYSTEM_NOTIFICATIONS_UNREAD_1"), EINA_FALSE);
544         } else {
545                 DEBUG("%d %s", noti_count, _("IDS_SYSTEM_NOTIFICATIONS_UNREAD_MANY"));
546
547                 if (asprintf(&buffer, "%d %s", noti_count, _("IDS_SYSTEM_NOTIFICATIONS_UNREAD_MANY"))) {
548                         ERROR("buffer length equals 0");
549                 }
550
551                 tts_speak(buffer, EINA_FALSE);
552                 free(buffer);
553         }
554
555         ret = notification_free_list(list);
556         if (ret != NOTIFICATION_ERROR_NONE) {
557                 ERROR("ret == %d", ret);
558         }
559 }
560
561 void device_date_get(void)
562 {
563         char buffer[DATE_TIME_BUFFER_SIZE];
564         int date_format = SETTING_DATE_FORMAT_DD_MM_YYYY;
565         int ret = -1;
566         time_t rawtime = 0;
567         struct tm *timeinfo = NULL;
568
569         if (!_read_text_get(VCONFKEY_SETAPPL_ACCESSIBILITY_TTS_INDICATOR_INFORMATION_DATE)) {
570                 return;
571         }
572
573         time(&rawtime);
574         timeinfo = localtime(&rawtime);
575         if (!timeinfo) {
576                 ERROR("localtime returns NULL");
577                 return;
578         }
579
580         strftime(buffer, DATE_TIME_BUFFER_SIZE, "%Y:%m:%d %H:%M:%S", timeinfo);
581
582         ret = vconf_get_int(VCONFKEY_SETAPPL_DATE_FORMAT_INT, &date_format);
583         if (ret != 0) {
584                 ERROR("ret == %d", ret);
585         }
586
587         switch (date_format) {
588         case SETTING_DATE_FORMAT_DD_MM_YYYY:
589                 strftime(buffer, DATE_TIME_BUFFER_SIZE, "%d %B %Y", timeinfo);
590                 break;
591
592         case SETTING_DATE_FORMAT_MM_DD_YYYY:
593                 strftime(buffer, DATE_TIME_BUFFER_SIZE, "%B %d %Y", timeinfo);
594                 break;
595
596         case SETTING_DATE_FORMAT_YYYY_MM_DD:
597                 strftime(buffer, DATE_TIME_BUFFER_SIZE, "%Y %B %d", timeinfo);
598                 break;
599
600         case SETTING_DATE_FORMAT_YYYY_DD_MM:
601                 strftime(buffer, DATE_TIME_BUFFER_SIZE, "%Y %d %B", timeinfo);
602                 break;
603         }
604
605         DEBUG("Text to say: %s", buffer);
606         tts_speak(buffer, EINA_FALSE);
607 }
608
609 static bool bonded_device_count_cb(bt_device_info_s * device_info, void *user_data)
610 {
611         int *device_count = (int *)user_data;
612
613         (*device_count)++;
614
615         return true;
616 }
617
618 static bool bonded_device_get_cb(bt_device_info_s * device_info, void *user_data)
619 {
620         char **device_name = (char **)user_data;
621
622         if (asprintf(device_name, "%s connected", device_info->remote_name)) {
623                 ERROR("buffer length == 0");
624         }
625
626         return false;
627 }
628
629 void device_bluetooth_get(void)
630 {
631         char *buffer = NULL;
632         int device_count = 0;
633
634         if (!_read_text_get(VCONFKEY_SETAPPL_ACCESSIBILITY_TTS_INDICATOR_INFORMATION_BLUETOOTH)) {
635                 return;
636         }
637
638         bt_adapter_state_e adapter_state = BT_ADAPTER_DISABLED;
639         int ret = bt_adapter_get_state(&adapter_state);
640         if (ret != BT_ERROR_NONE) {
641                 ERROR("ret == %d", ret);
642                 return;
643         }
644
645         if (adapter_state == BT_ADAPTER_DISABLED) {
646                 DEBUG("Text to say: %s", _("IDS_SYSTEM_BT_BLUETOOTH_OFF"));
647                 tts_speak(_("IDS_SYSTEM_BT_BLUETOOTH_OFF"), EINA_FALSE);
648                 return;
649         } else {
650                 bt_adapter_foreach_bonded_device(bonded_device_count_cb, (void *)&device_count);
651
652                 if (device_count == 0) {
653                         if (!asprintf(&buffer, _("IDS_SYSTEM_BT_NO_DEVICES_CONNECTED"))) {
654                                 ERROR("buffer length == 0");
655                         }
656                 } else if (device_count == 1) {
657                         bt_adapter_foreach_bonded_device(bonded_device_get_cb, &buffer);
658                 } else {
659                         if (asprintf(&buffer, "%d %s", device_count, _("IDS_SYSTEM_BT_DEVICES_CONNECTED_COUNT"))) {
660                                 ERROR("buffer length == 0");
661                         }
662                 }
663
664                 DEBUG("Text to say: %s", buffer);
665                 tts_speak(buffer, EINA_FALSE);
666                 free(buffer);
667         }
668 }
669
670 #endif