ttsynth and speakup connector.
Lukas Loehrer
listaddr1 at gmx.net
Sat Jun 9 12:32:24 EDT 2007
Luke Yelavich writes ("ttsynth and speakup connector."):
> speech does not shut up very quickly when one presses a key, or the
> control key. Speech also overlaps when quickly skimming over text,
> either by line, word, or character. I'd say this has something to do
> with ALSA being used, but is probably not too hard to work around in the
> code. The utility also randomly crashes sometimes, and I hope to see if
> I can debug that.
The overlapping speech problem could be related to the use of a too
large hardware buffer size in conjuction with software mixing (dmix).
I suppose that when software mixing is used, the snd_pcm_drop()
function called by one process cannot cancel waveform data that is
already written to the buffer shared by all processes, otherwise it
would also cancel data written by other processes. Anyway, the
solution is to use a relatively small hardware buffer. You can use
snd_pcm_hw_params_set_buffer_size_near (), however, this can fail if
other processes have already set a larger buffer size. In my
experience, the best way to force a consistently small buffer is to
use a ~/.asoundrc file and force the buffer and period size there. I
pasted mine at the end of this mail. The emacspeak svn repository
contains another a bit more sophisticated example:
http://emacspeak.googlecode.com/svn/trunk/servers/linux-outloud/asoundrc
Best regards, Lukas
Example follows:
pcm.!default {
type plug
slave.pcm "dmixer"
}
pcm.dmixer {
type dmix
ipc_key 1024
ipc_perm 0660
ipc_key_add_uid false
ipc_gid audio
slave {
pcm "hw:0,0"
format s16_LE
period_time 0
period_size 1024
buffer_size 4096
rate 44100
}
bindings {
0 0
1 1
}
}
ctl.!default {
type hw
card 0
}
More information about the Speakup
mailing list