summaryrefslogtreecommitdiff
blob: 76a58506e1da4724704d871ab9a36f302de63617 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/sbin/runscript
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$

SPEAKUPDEV=/dev/softsynth
SPEAKUPDIR=/sys/module/speakup/parameters

depend() {
	use eflite festival
	need speech-dispatcher
}

check_speakup() {
	if [ ! -d ${SPEAKUPDIR} ]; then
		eerror "Speakup is not currently running."
		eerror "Please correct this before using speechd-up."
		return 1
	fi

	if [ ! -c ${SPEAKUPDEV} ]; then
		mknod ${SPEAKUPDEV} c 10 26
	fi
	echo soft > ${SPEAKUPDIR}/synth
	sleep 1
}

start() {
	check_speakup || return 1
	ebegin "Starting speechd-up"
	start-stop-daemon --start --quiet --nicelevel ${NICELEVEL} --exec /usr/bin/speechd-up -- -d -t
	eend $?
}

stop() {
	ebegin "Stopping speechd-up"
	start-stop-daemon --stop --quiet --pidfile /var/run/speechd-up.pid
	eend $?
}