From bc56ff4b1941a11f167c5af20445601ff057a862 Mon Sep 17 00:00:00 2001 From: gnuite Date: Thu, 16 Oct 2008 07:50:29 +0000 Subject: [PATCH] Fixed flite invocation bug. git-svn-id: svn+ssh://garage/var/lib/gforge/svnroot/maemo-mapper/trunk@217 6c538b50-5814-0410-93ad-8bdf4c0149d1 --- src/defines.h | 2 ++ src/path.c | 7 +++++-- src/settings.c | 10 ++++++++++ 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/src/defines.h b/src/defines.h index 6f209ae..c156afb 100644 --- a/src/defines.h +++ b/src/defines.h @@ -314,4 +314,6 @@ g_free(my_macro_buffer); \ } +#define _voice_synth_path "/usr/bin/flite" + #endif /* ifndef MAEMO_MAPPER_DEFINES */ diff --git a/src/path.c b/src/path.c index 2fbf94f..50bf3ca 100644 --- a/src/path.c +++ b/src/path.c @@ -939,11 +939,14 @@ track_add(time_t time, gboolean newly_fixed) hildon_play_system_sound( "/usr/share/sounds/ui-information_note.wav"); sleep(1); -# define _voice_synth_path "/usr/bin/flite" printf("%s %s\n", _voice_synth_path, _last_spoken_phrase); - execl("/bin/sh", _voice_synth_path, _voice_synth_path, + execl(_voice_synth_path, basename(_voice_synth_path), "-t", _last_spoken_phrase, (char *)NULL); + /* No good? Try to launch it with /bin/sh */ + execl("/bin/sh", "sh", "-c", _voice_synth_path, + "-t", _last_spoken_phrase, (char *)NULL); + /* Still no good? Oh well... */ exit(0); } } diff --git a/src/settings.c b/src/settings.c index e1ef2dd..ba46750 100644 --- a/src/settings.c +++ b/src/settings.c @@ -2100,6 +2100,16 @@ settings_init() else _enable_voice = TRUE; + if(_enable_voice) + { + /* Make sure we actually have voice capabilities. */ + GnomeVFSFileInfo file_info; + _enable_voice = ((GNOME_VFS_OK == gnome_vfs_get_file_info( + _voice_synth_path, &file_info, + GNOME_VFS_FILE_INFO_GET_ACCESS_RIGHTS)) + && (file_info.permissions & GNOME_VFS_PERM_ACCESS_EXECUTABLE)); + } + /* Get Fullscreen flag. Default is FALSE. */ _fullscreen = gconf_client_get_bool(gconf_client, GCONF_KEY_FULLSCREEN, NULL); -- 2.44.0