Skip to content

Commit 7e16f43

Browse files
committed
0.20190921: Fix #1 and #2: zcat -> gzip -dcf
1 parent de2108e commit 7e16f43

File tree

5 files changed

+23
-19
lines changed

5 files changed

+23
-19
lines changed

CHANGELOG

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
0.20190921
2+
3+
Fix #1 and #2: zcat -> gzip -dcf
4+
15
0.20190517
26

37
Return to RHVoice-test

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
RHVoiceBookReader
2-
0.20180630
2+
0.20190921
33

44
# RHVoiceBookReader
55

@@ -48,6 +48,6 @@ all:
4848
* [license-lgpl_3.0-20171206_all.deb](https://sourceforge.net/projects/debiannoofficial/files/wheezy-update/doc/license-lgpl_3.0-20171206_all.deb)
4949

5050
---
51-
2018
51+
2019
5252
zvezdochiot
5353

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.20190517
1+
0.20190921

man/man1/rhvoiceplay.1

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.TH "RHVoicePlay" 0.20180704 "04 Jul 2018" "User documentation"
1+
.TH "RHVoicePlay" 0.20190921 "21 Aug 2019" "User documentation"
22
.SH NAME
33
rhvoiceplay
44
.SH DESCRIPTION
@@ -8,17 +8,17 @@ rhvoiceplay [options] book.txt|-|string
88
.SH OPTIONS
99
.TP
1010
-l N
11-
line begin [N=0-100] (only .txt, default = 0)
11+
line begin [N=0-1000] (only .txt, default = 0)
1212
.TP
1313
-s str
14-
RHVoice speaker (RHVoice >=0.5, default = aleksandr)
14+
RHVoice speaker (RHVoice >=0.5, default = elena)
1515
.TP
1616
-h
1717
help
1818
.SH EXAMPLES
19-
rhvoiceplay -s elena book.txt.gz
19+
rhvoiceplay book.txt.gz
2020
.SH COPYRIGHT
21-
(c) 2018 zvezdochiot.
22-
All rights reserved.
21+
Public Domain Mark 1.0
22+
No Copyright
2323
.SH "SEE ALSO"
2424
speech-dispatcher

rhvoiceplay.sh

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
#!/bin/sh
1+
#!/bin/bash
22
#rhvoiceplay.sh
3-
#Depends: dash, sed, gzip | zutils, rhvoice, aplay | sox
3+
#Depends: bash, sed, gzip, rhvoice, aplay | sox
44

55
sname="RHVoicePlay"
6-
sversion="0.20190517"
6+
sversion="0.20190921"
77

88
echo "$sname $sversion" >&2
99

1010
tnocomp=""
1111
tcomp="sed"
1212
[ ! "$(command -v $tcomp)" ] && tnocomp="$tnocomp $tcomp"
13-
tcomp="zcat"
13+
tcomp="gzip"
1414
[ ! "$(command -v $tcomp)" ] && tnocomp="$tnocomp $tcomp"
1515
tcomp="RHVoice"
1616
tcompa="RHVoice-test"
@@ -26,7 +26,7 @@ then
2626
fi
2727

2828
tln=0
29-
tspeaker="aleksandr"
29+
tspeaker="elena"
3030
fhlp="false"
3131
while getopts ":l:s:h" opt
3232
do
@@ -50,8 +50,8 @@ then
5050
echo "Usage:"
5151
echo "$0 [options] book.txt|-|string"
5252
echo "Options:"
53-
echo " -l N line begin [N=0-100] (only .txt, default = 0)"
54-
echo " -s str RHVoice speaker (RHVoice >=0.5, default = aleksandr)"
53+
echo " -l N line begin [N=0-1000] (only .txt, default = 0)"
54+
echo " -s str RHVoice speaker (RHVoice >=0.5, default = elena)"
5555
echo " -h help"
5656
exit 0
5757
fi
@@ -63,11 +63,11 @@ tplay="aplay"
6363

6464
if [ -f "$text" ]
6565
then
66-
textsize=$(zcat "$text" | sed -e 's/[\.\?\!\…] /&\n/g' | sed -e '/^$/d' | wc -l)
66+
textsize=$(gzip -dcf "$text" | sed -e 's/[\.\?\!\…] /&\n/g' | sed -e '/^$/d' | wc -l)
6767
echo "$text: $textsize" >&2
68-
tln=$(($tln*$textsize/100))
68+
tln=$(($tln*$textsize/1000))
6969
i=$tln
70-
zcat "$text" | sed -e 's/[\.\?\!\…] /&\n/g' | sed -e '/^$/d' | sed -e "1,${tln}d" | while read tline; do p=$((10000*$i/$textsize)); p1=$(($p/100)); p2=$(($p-$p1*100)); printf "%02d.%02d: " $p1 $p2; echo "$tline"; echo "$tline" | $trhvoice 2>/dev/null | $tplay - 2>/dev/null; i=$(($i+1)); done
70+
gzip -dcf "$text" | sed -e 's/[\.\?\!\…] /&\n/g' | sed -e '/^$/d' | sed -e "1,${tln}d" | while read tline; do p=$((10000*$i/$textsize)); p1=$(($p/10)); p2=$(($p-$p1*10)); printf "%03d.%01d: " $p1 $p2; echo "$tline"; echo "$tline" | $trhvoice 2>/dev/null | $tplay - 2>/dev/null; i=$(($i+1)); done
7171
elif [ "x$text" = "x-" ]
7272
then
7373
while read tline; do printf ": "; echo "$tline"; echo "$tline" | $trhvoice 2>/dev/null | $tplay - 2>/dev/null; done

0 commit comments

Comments
 (0)