summaryrefslogtreecommitdiff
path: root/speech.c
diff options
context:
space:
mode:
authormartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>2006-01-03 21:37:48 +0000
committermartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>2006-01-03 21:37:48 +0000
commit1413848bc67a5bcbfafbd91b103fd5566808e1b6 (patch)
treee2137a19136470025a208143d36b6cf6817afcfe /speech.c
parentd20ddd91dad0fd1ddf8c2c6634ae9fc342ee8a6e (diff)
downloadnavit-svn-1413848bc67a5bcbfafbd91b103fd5566808e1b6.tar.gz
Converting speech.c to new speechd api
git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit/src@55 ffa7fe5e-494d-0410-b361-a75ebd5db220
Diffstat (limited to 'speech.c')
-rw-r--r--speech.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/speech.c b/speech.c
index 0cb39e1b..fa9ab333 100644
--- a/speech.c
+++ b/speech.c
@@ -1,5 +1,5 @@
/* speechd simple client program
- * CVS revision: $Id: speech.c,v 1.3 2005-12-02 13:26:31 martin-s Exp $
+ * CVS revision: $Id: speech.c,v 1.4 2006-01-03 21:37:48 martin-s Exp $
* Author: Tomas Cerha <cerha@brailcom.cz> */
#include <sys/types.h>
@@ -18,25 +18,24 @@
#include "speech.h"
struct speech {
- int sockfd;
+#ifdef HAVE_LIBSPEECHD
+ SPDConnection *conn;
+#endif
};
struct speech *
speech_new(void) {
#ifdef HAVE_LIBSPEECHD
struct speech *this;
- int sockfd;
+ SPDConnection *conn;
-#ifdef SPD_FATAL
- sockfd = spd_open("map","main",NULL);
-#else
- sockfd = spd_init("map","main");
-#endif
- if (sockfd == 0)
+ conn = spd_open("navit","main",NULL,SPD_MODE_SINGLE);
+ if (! conn)
return NULL;
this=g_new(struct speech,1);
if (this) {
- this->sockfd=sockfd;
+ this->conn=conn;
+ spd_set_punctuation(conn, SPD_PUNCT_NONE);
}
return this;
#else
@@ -49,7 +48,7 @@ speech_say(struct speech *this, char *text) {
#ifdef HAVE_LIBSPEECHD
int err;
- err = spd_sayf(this->sockfd, 2, text);
+ err = spd_sayf(this->conn, SPD_MESSAGE, text);
if (err != 1)
return 1;
#endif
@@ -72,7 +71,7 @@ speech_sayf(struct speech *this, char *format, ...) {
int
speech_destroy(struct speech *this) {
#ifdef HAVE_LIBSPEECHD
- spd_close(this->sockfd);
+ spd_close(this->conn);
g_free(this);
#endif
return 0;