diff options
author | B. Watson <yalhcru@gmail.com> | 2021-08-02 16:46:05 -0400 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2021-10-13 00:51:28 +0700 |
commit | 4956ca10e3d6d9736425d1e11bc5d9120b9a849d (patch) | |
tree | 9865b6bc3e3bf2501e801fbcd1e3cecc763881d2 | |
parent | 8e9bae1e816e7b09a5c9fc364fd365b9fa300b6d (diff) |
accessibility/svox: Add man page for pico2audio.
Signed-off-by: B. Watson <yalhcru@gmail.com>
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
-rw-r--r-- | accessibility/svox/pico2audio | 19 | ||||
-rw-r--r-- | accessibility/svox/pico2audio.1 | 89 | ||||
-rw-r--r-- | accessibility/svox/pico2audio.rst | 70 | ||||
-rw-r--r-- | accessibility/svox/pico2wave.1 | 14 | ||||
-rw-r--r-- | accessibility/svox/svox.SlackBuild | 27 |
5 files changed, 202 insertions, 17 deletions
diff --git a/accessibility/svox/pico2audio b/accessibility/svox/pico2audio index 4f09c8805bf9..673950eb838c 100644 --- a/accessibility/svox/pico2audio +++ b/accessibility/svox/pico2audio @@ -17,7 +17,7 @@ Exit status of $SELF is that of pico2wave. Examples: $SELF 'Hello world.' - Speaks "Hello world" in the default language (en-US) + Speaks "Hello world" in the default language (en-US). $SELF -l en-GB 'Hello world.' As above, in a British accent. @@ -39,6 +39,10 @@ case "$1" in ;; -l) LOPT="$1 $2" shift + if [ -z "$1" ]; then + echo "$(basename $0): missing argument to -l option" 1>&2 + exit 1 + fi shift ;; -l?*) LOPT="$1" @@ -46,15 +50,22 @@ case "$1" in ;; esac +which pico2wave >/dev/null || exit 1 +which play >/dev/null || exit 1 + 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 +# the actual pico2wave command accepts multiple word arguments, +# but only speaks the first one (silently ignores the rest). +# here we combine all the word args into one quoted string and +# pass it to pico2wave via eval, so it sees one argument, possibly +# with spaces. +[ -n "$*" ] && ARGS="\"$@\"" -pico2wave $LOPT -w $DIR/tmp.wav "$@" +eval pico2wave $LOPT -w $DIR/tmp.wav $ARGS E="$?" play -q $DIR/tmp.wav 2>/dev/null rm -rf $DIR diff --git a/accessibility/svox/pico2audio.1 b/accessibility/svox/pico2audio.1 new file mode 100644 index 000000000000..684dfa16857c --- /dev/null +++ b/accessibility/svox/pico2audio.1 @@ -0,0 +1,89 @@ +.\" Man page generated from reStructuredText. +. +. +.nr rst2man-indent-level 0 +. +.de1 rstReportMargin +\\$1 \\n[an-margin] +level \\n[rst2man-indent-level] +level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] +- +\\n[rst2man-indent0] +\\n[rst2man-indent1] +\\n[rst2man-indent2] +.. +.de1 INDENT +.\" .rstReportMargin pre: +. RS \\$1 +. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] +. nr rst2man-indent-level +1 +.\" .rstReportMargin post: +.. +.de UNINDENT +. RE +.\" indent \\n[an-margin] +.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] +.nr rst2man-indent-level -1 +.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] +.in \\n[rst2man-indent\\n[rst2man-indent-level]]u +.. +.TH "PICO2AUDIO" 1 "2021-08-02" "20210802" "SlackBuilds.org" +.SH NAME +pico2audio \- text-to-speech wrapper for pico2wave +.\" RST source for pico2audio(1) man page. Convert with: +. +.\" rst2man.py pico2audio.rst > pico2audio.1 +. +.\" rst2man.py comes from the SBo development/docutils package. +. +.\" converting from pod: +. +.\" s/B<\([^>]*\)>/**\1**/g +. +.\" s/I<\([^>]*\)>/*\1*/g +. +.SH SYNOPSIS +.sp +pico2audio [\fI\-l <language>\fP] [\fIwords\fP] +.SH DESCRIPTION +.sp +\fBpico2audio\fP is a shell script wrapper for \fBpico2wave\fP\&. It renders text to +speech and plays it using the \fBplay\fP command. +.sp +If a \fI\-l <language>\fP option is given, it will be passed to pico2wave. See +\fBpico2wave\fP(1) for details. +.sp +If \fIwords\fP are given, they are used as input. Unlike the pico2wave command, +there\(aqs no requirement to quote multiple words. If no \fIwords\fP are given, +words are read from standard input. +.sp +Exit status is that of \fBpico2wave\fP\&. +.SH EXAMPLES +.sp +Examples: +.INDENT 0.0 +.INDENT 3.5 +.INDENT 0.0 +.TP +.B pico2audio Hello world. +Speaks "Hello world" in the default language (en\-US). +.TP +.B pico2audio \-l en\-GB Hello world. +As above, in a British accent. +.TP +.B fortune \-s | pico2audio +Reads from standard input. +.TP +.B pico2audio < /etc/motd +Speak a text file. Don\(aqt forget the \fB<\fP or it says the filename instead. +.UNINDENT +.UNINDENT +.UNINDENT +.SH AUTHOR +.sp +pico2audio was written by B. Watson, and is licensed under the WTFPL. +.SH SEE ALSO +.sp +\fBpico2wave\fP(1), \fBplay\fP(1) +.\" Generated by docutils manpage writer. +. diff --git a/accessibility/svox/pico2audio.rst b/accessibility/svox/pico2audio.rst new file mode 100644 index 000000000000..c6e537e28fb0 --- /dev/null +++ b/accessibility/svox/pico2audio.rst @@ -0,0 +1,70 @@ +.. RST source for pico2audio(1) man page. Convert with: +.. rst2man.py pico2audio.rst > pico2audio.1 +.. rst2man.py comes from the SBo development/docutils package. + +.. |version| replace:: 20210802 +.. |date| date:: + +.. converting from pod: +.. s/B<\([^>]*\)>/**\1**/g +.. s/I<\([^>]*\)>/*\1*/g + +========== +pico2audio +========== + +------------------------------------ +text-to-speech wrapper for pico2wave +------------------------------------ + +:Manual section: 1 +:Manual group: SlackBuilds.org +:Date: |date| +:Version: |version| + +SYNOPSIS +======== + +pico2audio [*-l <language>*] [*words*] + +DESCRIPTION +=========== + +**pico2audio** is a shell script wrapper for **pico2wave**. It renders text to +speech and plays it using the **play** command. + +If a *-l <language>* option is given, it will be passed to pico2wave. See +**pico2wave**\(1) for details. + +If *words* are given, they are used as input. Unlike the pico2wave command, +there's no requirement to quote multiple words. If no *words* are given, +words are read from standard input. + +Exit status is that of **pico2wave**. + +EXAMPLES +======== + +Examples: + + pico2audio Hello world. + Speaks "Hello world" in the default language (en-US). + + pico2audio -l en-GB Hello world. + As above, in a British accent. + + fortune -s | pico2audio + Reads from standard input. + + pico2audio < /etc/motd + Speak a text file. Don't forget the **<** or it says the filename instead. + +AUTHOR +====== + +pico2audio was written by B. Watson, and is licensed under the WTFPL. + +SEE ALSO +======== + +**pico2wave**\(1), **play**\(1) diff --git a/accessibility/svox/pico2wave.1 b/accessibility/svox/pico2wave.1 index 13da7e31f5c0..9d1a566778b5 100644 --- a/accessibility/svox/pico2wave.1 +++ b/accessibility/svox/pico2wave.1 @@ -1,5 +1,5 @@ .\" This file modified from the Debian version by B. Watson <yalhcru@gmail.com> -.TH PICO2WAVE "1" "June 2018" "pico2wave" "SlackBuilds.org" +.TH PICO2WAVE "1" "August 2021" "pico2wave" "SlackBuilds.org" .SH NAME pico2wave \- Small Footprint TTS .SH SYNOPSIS @@ -16,11 +16,16 @@ 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 +.B Note: +Only one \fI<words>\fR argument is spoken. Any further arguments are silently +ignored. This means that you must quote your argument, if it has multiple +words (e.g. a sentence). +.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 +(GB and US), Spanish, French and Italian. SVOX produces clear and +distinct speech output, made possible by the use of Hidden Markov Model (HMM) algorithms. .SH OPTIONS .TP @@ -59,3 +64,6 @@ Same as above, reading from standard input. pico2wav -w test.wav < gettysburg_address.txt .PP Convert an entire text file to speech. +.SH SEE ALSO +.sp +\fBpico2audio\fP(1) diff --git a/accessibility/svox/svox.SlackBuild b/accessibility/svox/svox.SlackBuild index 39fa5ca2cf77..3c572b6fe2b0 100644 --- a/accessibility/svox/svox.SlackBuild +++ b/accessibility/svox/svox.SlackBuild @@ -12,7 +12,7 @@ # 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. +# so it doesn't quite comply with its own license. # Notes to self: @@ -22,11 +22,18 @@ # listed as "www.android.com", it seems more useful to set HOMEPAGE # to the Debian page for svox. +# 20210802 bkw: BUILD=2 +# - update pico2audio script to support multiple words without quotes. +# - add man page for pico2audio. +# - update pico2wave man page. +# - add svox man page symlink, in case someone remembers the name of the +# package but not the name of the binary. + cd $(dirname $0) ; CWD=$(pwd) PRGNAM=svox VERSION=${VERSION:-1.0+git20130326_8} -BUILD=${BUILD:-1} +BUILD=${BUILD:-2} TAG=${TAG:-_SBo} PKGTYPE=${PKGTYPE:-tgz} @@ -38,9 +45,6 @@ if [ -z "$ARCH" ]; then esac fi -# If the variable PRINT_PACKAGE_NAME is set, then this script will report what -# the name of the created package would be, and then exit. This information -# could be useful to other scripts. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE" exit 0 @@ -81,11 +85,8 @@ 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 {} \+ +find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \ + \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+ # Apply all of Debian's patches. Many thanks to the Debian maintainers # for all the work that went into these patches. @@ -128,8 +129,14 @@ 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. +# 20210802 bkw: Added a man page for the pico2audio script, too. +# Please don't add pico2audio.rst to the package, and please don't +# remove it from the repo because it's not in the package: it's the +# source for pico2audio.1. mkdir -p $PKG/usr/man/man1 gzip -9c < $CWD/pico2wave.1 > $PKG/usr/man/man1/pico2wave.1.gz +ln -s pico2wave.1.gz $PKG/usr/man/man1/$PRGNAM.1.gz +gzip -9c < $CWD/pico2audio.1 > $PKG/usr/man/man1/pico2audio.1.gz mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION cat ../debian/copyright > $PKG/usr/doc/$PRGNAM-$VERSION/copyright |