+struct espeaktime_settings {
+ const gchar *voice;
+ const gchar *effect;
+ const gchar *text;
+ gint amplitude;
+ gint pitch;
+ gint speed;
+};
+
+static void do_test(struct espeaktime_settings *cfg)
+{
+ gchar astr[16], pstr[16], sstr[16];
+ gchar vstr[64];
+ gchar text[4096];
+ time_t t;
+ struct tm *tm;
+ int res;
+ pid_t pid;
+
+ pid = fork();
+ if (pid < 0) {
+ perror("fork");
+ return;
+ }
+ if (pid)
+ return;
+ time(&t);
+ tm = localtime(&t);
+
+ g_snprintf(astr, sizeof(astr), "%d", cfg->amplitude);
+ g_snprintf(pstr, sizeof(pstr), "%d", cfg->pitch);
+ g_snprintf(sstr, sizeof(sstr), "%d", cfg->speed);
+ g_snprintf(vstr, sizeof(vstr), "%s%s%s", cfg->voice,
+ (*cfg->effect) ? "+" : "", cfg->effect);
+ strftime(text, sizeof(text), cfg->text, tm);
+ g_print("execlp: -a '%s' -p '%s' -v '%s' '%s'\n",
+ astr, pstr, sstr, vstr, text);
+ res = execlp(ESPEAK_BIN, ESPEAK_BIN,
+ "-a", astr, "-p", pstr, "-s", sstr, "-v", vstr,
+ text, NULL);
+ g_print("execlp: %d\n", res);
+}
+
+