diff options
Diffstat (limited to 'navit/speech/qt5_espeak/qt5_espeak.cpp')
-rwxr-xr-x | navit/speech/qt5_espeak/qt5_espeak.cpp | 30 |
1 files changed, 11 insertions, 19 deletions
diff --git a/navit/speech/qt5_espeak/qt5_espeak.cpp b/navit/speech/qt5_espeak/qt5_espeak.cpp index 266fde624..2bcb8fd6c 100755 --- a/navit/speech/qt5_espeak/qt5_espeak.cpp +++ b/navit/speech/qt5_espeak/qt5_espeak.cpp @@ -56,8 +56,7 @@ struct speech_priv { }; /* callback from espeak to transfer generated samples */ -int qt5_espeak_SynthCallback(short* wav, int numsamples, espeak_EVENT* events) -{ +int qt5_espeak_SynthCallback(short* wav, int numsamples, espeak_EVENT* events) { struct speech_priv* pr = NULL; dbg(lvl_debug, "Callback %d samples", numsamples); if (events != NULL) @@ -73,8 +72,7 @@ int qt5_espeak_SynthCallback(short* wav, int numsamples, espeak_EVENT* events) /* set up espeak */ static bool -qt5_espeak_init_espeak(struct speech_priv* sr, struct attr** attrs) -{ +qt5_espeak_init_espeak(struct speech_priv* sr, struct attr** attrs) { struct attr* path; /* prepare espeak library path home */ @@ -86,8 +84,8 @@ qt5_espeak_init_espeak(struct speech_priv* sr, struct attr** attrs) sr->path_home = g_strdup_printf("%s", getenv("NAVIT_SHAREDIR")); #else /* since no path was given by config, we don't know the path to external - * espeak data. - * so give NULL to use default path */ + * espeak data. + * so give NULL to use default path */ sr->path_home = NULL; #endif } @@ -112,8 +110,7 @@ qt5_espeak_init_espeak(struct speech_priv* sr, struct attr** attrs) /* set language to espeak */ static bool -qt5_espeak_init_language(struct speech_priv* pr, struct attr** attrs) -{ +qt5_espeak_init_language(struct speech_priv* pr, struct attr** attrs) { struct attr* language; gchar* lang_str = NULL; espeak_ERROR error; @@ -160,8 +157,7 @@ qt5_espeak_init_language(struct speech_priv* pr, struct attr** attrs) /* init audio system */ static bool -qt5_espeak_init_audio(struct speech_priv* sr, const char* category) -{ +qt5_espeak_init_audio(struct speech_priv* sr, const char* category) { try { sr->audio = new Qt5EspeakAudioOut(sr->sample_rate, category); } catch (void* exception) { @@ -176,12 +172,11 @@ qt5_espeak_init_audio(struct speech_priv* sr, const char* category) * text - new (utf8) text */ static int -qt5_espeak_say(struct speech_priv* sr, const char* text) -{ +qt5_espeak_say(struct speech_priv* sr, const char* text) { espeak_ERROR error; dbg(lvl_debug, "Say \"%s\"", text); error = espeak_Synth(text, strlen(text), 0, POS_CHARACTER, 0, - espeakCHARS_UTF8, NULL, sr); + espeakCHARS_UTF8, NULL, sr); if (error != EE_OK) dbg(lvl_error, "Unable to speak! error == %d", error); @@ -190,8 +185,7 @@ qt5_espeak_say(struct speech_priv* sr, const char* text) /* destructor */ static void -qt5_espeak_destroy(struct speech_priv* sr) -{ +qt5_espeak_destroy(struct speech_priv* sr) { dbg(lvl_debug, "Enter"); if (sr->path_home != NULL) @@ -212,8 +206,7 @@ static struct speech_methods qt5_espeak_meth = { */ static struct speech_priv* qt5_espeak_new(struct speech_methods* meth, struct attr** attrs, - struct attr* parent) -{ + struct attr* parent) { struct speech_priv* sr = NULL; dbg(lvl_debug, "Enter"); @@ -245,8 +238,7 @@ qt5_espeak_new(struct speech_methods* meth, struct attr** attrs, } /* initialize this as plugin */ -void plugin_init(void) -{ +void plugin_init(void) { dbg(lvl_debug, "Enter"); plugin_register_category_speech("qt5_espeak", qt5_espeak_new); } |