diff options
author | Lionel AINS <lains@caramail.com> | 2019-03-10 16:39:27 +0100 |
---|---|---|
committer | jkoan <jkoan@users.noreply.github.com> | 2019-03-26 08:33:21 +0000 |
commit | 7523c112affbf4f15fb04b5130b93cfc0a1d46fa (patch) | |
tree | befe19045afd2cc8b80b27fc62b7d264bc1ebd73 | |
parent | cc781eec9b8825d1ffbbb4798e2b86ac2d08be62 (diff) | |
download | navit-7523c112affbf4f15fb04b5130b93cfc0a1d46fa.tar.gz |
Replace hyphens with white spaces when using android speech
-rw-r--r-- | navit/speech/android/speech_android.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/navit/speech/android/speech_android.c b/navit/speech/android/speech_android.c index b76c2c3e9..fb0574166 100644 --- a/navit/speech/android/speech_android.c +++ b/navit/speech/android/speech_android.c @@ -36,7 +36,14 @@ struct speech_priv { static int speech_android_say(struct speech_priv *this, const char *text) { char *str=g_strdup(text); jstring string; - int i; + char *tok = str; + + /* Replace hyphens with white spaces, or some Android speech SDK will pronounce "hyphen" */ + while (*tok) { + if (*tok=='-') + *tok=' '; + tok++; + } string = (*jnienv)->NewStringUTF(jnienv, str); dbg(lvl_debug,"enter %s",str); |