aboutsummaryrefslogtreecommitdiff
path: root/accessibility
diff options
context:
space:
mode:
authorB. Watson <yalhcru@gmail.com>2018-06-17 22:23:45 +0100
committerDavid Spencer <idlemoor@slackbuilds.org>2018-06-17 22:23:45 +0100
commit25a8eead0087db861e96806c9dfec4b39d0fb220 (patch)
treef6482b1d2daa911375714253fbbeeeff7ae6d0bc /accessibility
parent5bc5e45e780a49bea80ab9216f4cf8b8dd8771bc (diff)
accessibility/svox: Added (small footprint text-to-speech engine).
Signed-off-by: David Spencer <idlemoor@slackbuilds.org>
Diffstat (limited to 'accessibility')
-rw-r--r--accessibility/svox/README10
-rw-r--r--accessibility/svox/dont_try_to_free_argv.diff12
-rw-r--r--accessibility/svox/pico2audio61
-rw-r--r--accessibility/svox/pico2wave.161
-rw-r--r--accessibility/svox/slack-desc19
-rw-r--r--accessibility/svox/svox.SlackBuild132
-rw-r--r--accessibility/svox/svox.info12
7 files changed, 307 insertions, 0 deletions
diff --git a/accessibility/svox/README b/accessibility/svox/README
new file mode 100644
index 000000000000..e632b22fb73b
--- /dev/null
+++ b/accessibility/svox/README
@@ -0,0 +1,10 @@
+svox (small footprint text-to-speech engine)
+
+The SVOX Pico engine is a software speech synthesizer for German, English
+(GB and US), Spanish, French and Italian. SVOX produces a clear and
+distinct speech output made possible by the use of Hidden Markov Model
+(HMM) algorithms.
+
+The package includes the pico2wave utility, and everything else from
+the Debian packages libttspico-data, libttspico-dev, libttspico-utils,
+and libttspico0.
diff --git a/accessibility/svox/dont_try_to_free_argv.diff b/accessibility/svox/dont_try_to_free_argv.diff
new file mode 100644
index 000000000000..04da6f9a5294
--- /dev/null
+++ b/accessibility/svox/dont_try_to_free_argv.diff
@@ -0,0 +1,12 @@
+diff -Naur svox-1.0+git20130326/pico/bin/pico2wave.c svox-1.0+git20130326.patched/pico/bin/pico2wave.c
+--- svox-1.0+git20130326/pico/bin/pico2wave.c 2018-06-17 02:50:56.203338391 -0400
++++ svox-1.0+git20130326.patched/pico/bin/pico2wave.c 2018-06-17 03:00:01.026324549 -0400
+@@ -371,8 +371,6 @@
+ pico_terminate(&picoSystem);
+ picoSystem = NULL;
+ }
+- if (text)
+- free(text);
+ exit(ret);
+ }
+
diff --git a/accessibility/svox/pico2audio b/accessibility/svox/pico2audio
new file mode 100644
index 000000000000..4f09c8805bf9
--- /dev/null
+++ b/accessibility/svox/pico2audio
@@ -0,0 +1,61 @@
+#!/bin/sh
+
+usage() {
+ SELF="$( basename $0 )"
+ INDT="$( echo $SELF | sed 's,., ,g' )"
+ cat <<EOF
+$SELF - wrapper for pico2wave, renders text to speech and
+$INDT plays it using the 'play' command.
+
+Written by B. Watson <yalhcru@gmail.com>, for the SlackBuilds.org project.
+Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
+
+If a -l <language> option is given, it will be passed to pico2wave.
+
+Exit status of $SELF is that of pico2wave.
+
+Examples:
+
+ $SELF 'Hello world.'
+ Speaks "Hello world" in the default language (en-US)
+
+ $SELF -l en-GB 'Hello world.'
+ As above, in a British accent.
+
+ fortune -s | $SELF
+ Reads from standard input.
+
+ $SELF < /etc/motd
+ Speak a text file. Don't forget the < or it says the filename instead.
+EOF
+}
+
+# main()
+
+case "$1" in
+ '-?'|-h|-help|--help)
+ usage
+ exit 0
+ ;;
+ -l) LOPT="$1 $2"
+ shift
+ shift
+ ;;
+ -l?*) LOPT="$1"
+ shift
+ ;;
+esac
+
+DIR=$( mktemp -t -d pico2audio.XXXXXX )
+if [ ! -d "$DIR" ]; then
+ exit 1 # mktemp already printed an error message
+fi
+
+which pico2wave >/dev/null || exit 1
+which play >/dev/null || exit 1
+
+pico2wave $LOPT -w $DIR/tmp.wav "$@"
+E="$?"
+play -q $DIR/tmp.wav 2>/dev/null
+rm -rf $DIR
+exit "$E"
diff --git a/accessibility/svox/pico2wave.1 b/accessibility/svox/pico2wave.1
new file mode 100644
index 000000000000..13da7e31f5c0
--- /dev/null
+++ b/accessibility/svox/pico2wave.1
@@ -0,0 +1,61 @@
+.\" This file modified from the Debian version by B. Watson <yalhcru@gmail.com>
+.TH PICO2WAVE "1" "June 2018" "pico2wave" "SlackBuilds.org"
+.SH NAME
+pico2wave \- Small Footprint TTS
+.SH SYNOPSIS
+.B pico2wave
+\fB-w\fR
+\fI<filename.wav>\fR
+[ \fB-l\fR \fI<language>\fR ]
+[ \fI<words>\fR ]
+.SH DESCRIPTION
+.B pico2wave
+is a small footprint Text to Speech utility, using the SVOX Pico
+engine \fB[*]\fR. It converts
+text given on the command line (or standard input, if no
+\fI<words>\fR on command line) to audible speech, and writes
+to a RIFF .wav file.
+.PP
+The generated wav files are PCM, 16-bit mono, 16KHz sampling rate.
+.PP
+\fB[*]\fR The SVOX Pico engine is a software speech synthesizer for German, English
+(GB and US), Spanish, French and Italian. SVOX produces a clear and
+distinct speech output made possible by the use of Hidden Markov Model
+(HMM) algorithms.
+.SH OPTIONS
+.TP
+\fB\-w\fR, \fB\-\-wave\fR=\fIfilename\fR.wav
+Write output to this WAV file (extension SHOULD
+be .wav). This option is required: \fBpico2wave\fR
+cannot write to standard output (not even if you
+use \fB-w /dev/stdout\fR, sorry). If the file
+already exists, it will be \fBoverwritten\fR with no
+confirmation or warning.
+.TP
+\fB\-l\fR, \fB\-\-lang\fR=\fIlang\fR
+Language (default: \fBen\-US\fR). The languages supported are
+currently \fBde\-DE\fR, \fBen\-GB\fR, \fBen\-US\fR,
+\fBes\-ES\fR, \fBfr\-FR\fR, \fBit\-IT\fR.
+.SS "Help options:"
+.TP
+\-?, \fB\-\-help\fR
+Show help message
+.TP
+\fB\-\-usage\fR
+Display brief usage message
+.SH EXAMPLES
+.TP
+.B
+pico2wav -w test.wav 'Hello, world.'
+.PP
+Creates a file \fBtest.wav\fR containing the words "Hello, world."
+.TP
+.B
+echo 'Hello, world.' | pico2wav -w test.wav
+.PP
+Same as above, reading from standard input.
+.TP
+.B
+pico2wav -w test.wav < gettysburg_address.txt
+.PP
+Convert an entire text file to speech.
diff --git a/accessibility/svox/slack-desc b/accessibility/svox/slack-desc
new file mode 100644
index 000000000000..fe3117dd9ef6
--- /dev/null
+++ b/accessibility/svox/slack-desc
@@ -0,0 +1,19 @@
+# HOW TO EDIT THIS FILE:
+# The "handy ruler" below makes it easier to edit a package description.
+# Line up the first '|' above the ':' following the base package name, and
+# the '|' on the right side marks the last column you can put a character in.
+# You must make exactly 11 lines for the formatting to be correct. It's also
+# customary to leave one space after the ':' except on otherwise blank lines.
+
+ |-----handy-ruler------------------------------------------------------|
+svox: svox (small footprint text-to-speech engine)
+svox:
+svox: The SVOX Pico engine is a software speech synthesizer for German,
+svox: English (GB and US), Spanish, French and Italian. SVOX produces a
+svox: clear and distinct speech output made possible by the use of Hidden
+svox: Markov Model (HMM) algorithms.
+svox:
+svox:
+svox:
+svox:
+svox:
diff --git a/accessibility/svox/svox.SlackBuild b/accessibility/svox/svox.SlackBuild
new file mode 100644
index 000000000000..cdbfdbf40d1b
--- /dev/null
+++ b/accessibility/svox/svox.SlackBuild
@@ -0,0 +1,132 @@
+#!/bin/sh
+
+# Slackware build script for svox
+
+# Written by B. Watson (yalhcru@gmail.com)
+
+# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
+
+# This is heavily based on Debian's packaging, see:
+# https://packages.debian.org/source/sid/svox
+
+# It's in the Debian non-free repo on a technicality: svox is free
+# software released under the Apache-2.0 license, but the sources
+# for the compiled voices (/usr/share/pico/lang/*.bin) are missing,
+# so it doesn't quite comply with the its own license.
+
+# Notes to self:
+
+# - The _8 in the version number is the Debian build number, keep it
+# in sync with future Debian updates.
+# - "Upstream" here is Debian, not Android. Debian has svox's homepage
+# listed as "www.android.com", it seems more useful to set HOMEPAGE
+# to the Debian page for svox.
+
+PRGNAM=svox
+VERSION=${VERSION:-1.0+git20130326_8}
+BUILD=${BUILD:-1}
+TAG=${TAG:-_SBo}
+
+if [ -z "$ARCH" ]; then
+ case "$( uname -m )" in
+ i?86) ARCH=i586 ;;
+ arm*) ARCH=arm ;;
+ *) ARCH=$( uname -m ) ;;
+ esac
+fi
+
+CWD=$(pwd)
+TMP=${TMP:-/tmp/SBo}
+PKG=$TMP/package-$PRGNAM
+OUTPUT=${OUTPUT:-/tmp}
+
+if [ "$ARCH" = "i586" ]; then
+ SLKCFLAGS="-O2 -march=i586 -mtune=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "i686" ]; then
+ SLKCFLAGS="-O2 -march=i686 -mtune=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "x86_64" ]; then
+ SLKCFLAGS="-O2 -fPIC"
+ LIBDIRSUFFIX="64"
+else
+ SLKCFLAGS="-O2"
+ LIBDIRSUFFIX=""
+fi
+
+set -e
+
+# Split up and recombine Debian's version number, we can't have a - in
+# a Slackware version number. And using the -8 for BUILD is a bad idea
+# (thanks for pointing that out, idlemoor).
+DEBVER="$( echo $VERSION | cut -d_ -f1 )"
+DEBBLD="$( echo $VERSION | cut -d_ -f2 )"
+PRGVER=${PRGNAM}_$DEBVER
+
+rm -rf $PKG
+mkdir -p $TMP $PKG $OUTPUT
+cd $TMP
+rm -rf $PRGNAM-$DEBVER
+tar xvf $CWD/$PRGVER.orig.tar.gz
+cd $PRGNAM-$DEBVER
+tar xvf $CWD/$PRGVER-$DEBBLD.debian.tar.xz
+chown -R root:root .
+find -L . \
+ \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
+ -o -perm 511 \) -exec chmod 755 {} \+ -o \
+ \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
+ -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \+
+
+# Apply all of Debian's patches. Many thanks to the Debian maintainers
+# for all the work that went into these patches.
+for i in $( cat debian/patches/series ); do
+ # use -e here to skip commented-out patches in 'series'.
+ [ -e debian/patches/$i ] && patch --verbose -p1 < debian/patches/$i
+done
+
+# Stop pico2wave from segfaulting on exit, when given words on the
+# command line. The code presumably works on Debian, maybe because
+# of differences in the popt library, or in glibc itself?
+patch --verbose -p1 < $CWD/dont_try_to_free_argv.diff
+
+cd pico
+autoreconf -if
+
+CFLAGS="$SLKCFLAGS" \
+CXXFLAGS="$SLKCFLAGS" \
+./configure \
+ --enable-shared \
+ --disable-static \
+ --prefix=/usr \
+ --libdir=/usr/lib${LIBDIRSUFFIX} \
+ --sysconfdir=/etc \
+ --localstatedir=/var \
+ --mandir=/usr/man \
+ --docdir=/usr/doc/$PRGNAM-$VERSION \
+ --build=$ARCH-slackware-linux
+
+make
+make install-strip DESTDIR=$PKG
+
+# We don't need this:
+rm $PKG/usr/lib$LIBDIRSUFFIX/*.la
+
+# It drives me nuts that pico2wave can't play to my speakers, so
+# I wrote a script:
+install -m0755 -oroot -groot $CWD/pico2audio $PKG/usr/bin
+
+# The original Debian man page was generated from the --help output. I've
+# expanded it to include a proper description, examples, a list of
+# allowed languages for the -l option, and a few other goodies.
+mkdir -p $PKG/usr/man/man1
+gzip -9c < $CWD/pico2wave.1 > $PKG/usr/man/man1/pico2wave.1.gz
+
+mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
+cat ../debian/copyright > $PKG/usr/doc/$PRGNAM-$VERSION/copyright
+cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
+
+mkdir -p $PKG/install
+cat $CWD/slack-desc > $PKG/install/slack-desc
+
+cd $PKG
+/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
diff --git a/accessibility/svox/svox.info b/accessibility/svox/svox.info
new file mode 100644
index 000000000000..64f6803b896a
--- /dev/null
+++ b/accessibility/svox/svox.info
@@ -0,0 +1,12 @@
+PRGNAM="svox"
+VERSION="1.0+git20130326_8"
+HOMEPAGE="https://packages.debian.org/source/sid/svox"
+DOWNLOAD="http://http.debian.net/debian/pool/non-free/s/svox/svox_1.0+git20130326.orig.tar.gz \
+ http://http.debian.net/debian/pool/non-free/s/svox/svox_1.0+git20130326-8.debian.tar.xz"
+MD5SUM="df4bf610ff4273b420e80ff64af93130 \
+ fe78ebb55777b01fbbde150e90d23e00"
+DOWNLOAD_x86_64=""
+MD5SUM_x86_64=""
+REQUIRES=""
+MAINTAINER="B. Watson"
+EMAIL="yalhcru@gmail.com"