Text-to-speech
I was looking at what was necessary to synthesize notifications received on a system (using festival, although I guess any other engine works as well).
My first thought was that I could write a seperate DBUS client for /org/freedeskto
I crudely patched notify-osd to achieve this effect
stack.c, line 605ish (in stack_notify_
<CODE>
gchar *argv[15];
memset (argv, 0 , 15*sizeof(gchar*));
argv[0]
argv[1]="--tts";
gint stdin_fd = -1;
GPid child_pid = 0;
if (g_spawn_
if (stdin_fd != -1) {
write(stdin_fd, filter_
write(stdin_fd, "\n\n", 2);
write(stdin_fd, filter_text(body), strlen(
write(stdin_fd, "\0", 1);
close(stdin_fd);
}
}
</CODE>
plus add
<CODE>
#include "util.h"
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
</CODE>
to the includes of this file.
Which seems to work, triggering TTS notifications asynchronously when new messages arrive (although without sanity features like avoiding multiple TTS instances running at once, or perhaps more importantly any way of turning it off).
My question is how should this be done properly? If my understanding that I cannot have multiple programs listening to DBUS for notifications in the first place is right, could there be some hook in notify-osd to allow custom actions/script to occur when a notification is received? Is there another level rather than notify-osd this should be happening at?
Gordon
Question information
- Language:
- English Edit question
- Status:
- Answered
- For:
- Notify OSD Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
Can you help with this problem?
Provide an answer of your own, or ask Gordon Ball for more information if necessary.