Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 5b58ed2
Showing
13 changed files
with
246 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
file_* | ||
*~ | ||
/ru/*.txt* | ||
/en/*.txt* | ||
/ru/[m|M]akefile* | ||
/en/[m|M]akefile* | ||
/ru/*/* | ||
/en/*/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
all: ru/Makefile en/Makefile run | ||
|
||
run: | ||
(cd ru; make;) | ||
(cd en; make;) | ||
|
||
%/Makefile: makefiles/makefile makefiles/makefile_ru makefiles/makefile_en | ||
cp $< $@ | ||
cp makefiles/makefile_`dirname $@` `dirname $@`/makefile.inc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
FILES := $(wildcard file_???) | ||
MP3S := $(FILES:%=%.mp3) | ||
DONES := $(FILES:%=.done.%) | ||
|
||
all: file_aaa | ||
$(MAKE) done | ||
|
||
file_aaa: src.txt | ||
$(RM) file_??? | ||
split -a 3 -l 10 src.txt file_ | ||
|
||
done: $(MP3S) .done | ||
|
||
.done: $(DONES) | ||
touch .done | ||
|
||
clean: | ||
$(RM) .done* $(FILES) $(MP3S) | ||
|
||
%.mp3: % | ||
rm -f .done .done.$< && echo | ||
~/scripts/festival/convfile_en.sh $< $@ || echo | ||
|
||
.done.%: % | ||
test -f $<.mp3 && touch $@ && eyeD3 -a "Festival" -G Speech --set-encoding=utf8 -t "`basename $$PWD`" $(<).mp3 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
FILES=$(wildcard *.txt) | ||
FILE_NAMES=$(FILES:%.txt=%/src.txt) | ||
DONE_FILES=$(FILES:%.txt=%/.done) | ||
MAKE_FILES=$(FILES:%.txt=%/Makefile) | ||
|
||
all: $(FILE_NAMES) $(MAKE_FILES) $(DONE_FILES) | ||
|
||
%/src.txt: %.txt | ||
mkdir -p `dirname $@` | ||
cp $< $@ | ||
rm -f `dirname $@`/.done | ||
|
||
%/.done: %/src.txt | ||
(cd `dirname $@`; nice -n 20 $(MAKE)) | ||
|
||
%/Makefile: makefile.inc | ||
cp $< $@ | ||
|
||
sync: | ||
rsync -r ~/festival/ 172.16.0.2:/home/jlarky/sync/festival --progress |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
FILES := $(wildcard file_???) | ||
MP3S := $(FILES:%=%.mp3) | ||
DONES := $(FILES:%=.done.%) | ||
|
||
all: file_aaa | ||
$(MAKE) done | ||
|
||
file_aaa: src.txt | ||
$(RM) file_??? | ||
split -a 3 -l 10 src.txt file_ | ||
|
||
done: $(MP3S) .done | ||
|
||
.done: $(DONES) | ||
touch .done | ||
|
||
clean: | ||
$(RM) .done* $(FILES) $(MP3S) | ||
|
||
%.mp3: % | ||
rm -f .done .done.$< && echo | ||
../../scripts/convfile_en.sh $< $@ || echo | ||
|
||
.done.%: % | ||
test -f $<.mp3 && touch $@ && eyeD3 -a "Festival" -G Speech --set-encoding=utf8 -t "`basename $$PWD`" $(<).mp3 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
FILES := $(wildcard file_???) | ||
MP3S := $(FILES:%=%.mp3) | ||
DONES := $(FILES:%=.done.%) | ||
|
||
all: file_aaa | ||
$(MAKE) done | ||
|
||
file_aaa: src.txt | ||
$(RM) file_??? | ||
split -a 3 -l 10 src.txt file_ | ||
|
||
done: $(MP3S) .done | ||
|
||
.done: $(DONES) | ||
touch .done | ||
|
||
clean: | ||
$(RM) .done* $(FILES) $(MP3S) | ||
|
||
%.mp3: % | ||
rm -f .done .done.$< && echo | ||
../../scripts/convfile_ru.sh $< $@ || echo | ||
|
||
.done.%: % | ||
test -f $<.mp3 && touch $@ && eyeD3 -a "Festival/ru" -G Speech --set-encoding=utf8 -t "`basename $$PWD`" $(<).mp3 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/usr/bin/python | ||
# -*- coding: utf-8 -*- | ||
import sys | ||
|
||
if not sys.argv[2:]: | ||
print "usage "+sys.argv[0]+": input output" | ||
exit(0) | ||
else: | ||
f_in, f_out = sys.argv[1:3] | ||
|
||
f = open(f_in) | ||
fout = open(f_out, 'w') | ||
line = '' | ||
while 1: | ||
prevline = line | ||
line = f.readline() | ||
line = line.decode("utf-8") | ||
|
||
if (len(line)>1) and (173)==ord(line[-2:-1]): | ||
print 123 | ||
#line = line.encode("utf-8") | ||
line = line[:-2] | ||
#line = line.decode("utf-8") | ||
|
||
char = line[0:1] | ||
if not char.isupper(): | ||
prevline = prevline.rstrip('\n')+" " | ||
fout.write(prevline.encode("utf-8")) | ||
if not line: break | ||
|
||
fout.write('\n') | ||
|
||
f.close() | ||
fout.close() | ||
|
||
print "all done, I guess..." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
FILES := $(wildcard file_???) | ||
MP3S := $(FILES:%=%.mp3) | ||
DONES := $(FILES:%=.done.%) | ||
|
||
all: file_aaa | ||
$(MAKE) done | ||
|
||
file_aaa: src.txt | ||
$(RM) file_??? | ||
split -a 3 -l 10 src.txt file_ | ||
|
||
done: $(MP3S) .done | ||
|
||
.done: $(DONES) | ||
touch .done | ||
|
||
clean: | ||
$(RM) .done* $(FILES) $(MP3S) | ||
|
||
%.mp3: % | ||
rm -f .done .done.$< && echo | ||
~/scripts/festival/convfile_ru.sh $< $@ || echo | ||
|
||
.done.%: % | ||
test -f $<.mp3 && touch $@ && eyeD3 -a "Festival/ru" -G Speech --set-encoding=utf8 -t "`basename $$PWD`" $(<).mp3 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/bash | ||
# http://ru.festivalspeaker.wikia.com | ||
|
||
#echo "$1" | text2wave -o - -eval "(voice_msu_ru_nsh_clunits)" | mplayer - | ||
[[ -z "$1" || -z "$2" ]] && echo "usage $0: input output" && exit 1 | ||
FILE=`mktemp` | ||
( | ||
[[ -f ".$1.sha1" ]] && sha1sum -c ".$1.sha1" --quiet 1>/dev/null 2>&1 && echo "already converted. remove .$1.sha1 to force" && touch "$2" && exit 0 | ||
rm -f "$2" | ||
`dirname $0`/fest2read.sh "$1" $FILE | ||
cat $FILE | text2wave -o - -eval "(audio_mode 'async)" -eval "(voice_ked_diphone)" | lame --abr 16 - "$2" | ||
); | ||
rm -f $FILE | ||
|
||
[[ -f "$2" ]] && (echo ok; sha1sum "$1" "$2" > ".$1.sha1") || (echo "Error while speaking file" && exit 1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/bash | ||
# http://ru.festivalspeaker.wikia.com | ||
|
||
#echo "$1" | text2wave -o - -eval "(voice_msu_ru_nsh_clunits)" | mplayer - | ||
[[ -z "$1" || -z "$2" ]] && echo "usage $0: input output" && exit 1 | ||
FILE=`mktemp` | ||
( | ||
[[ -f ".$1.sha1" ]] && sha1sum -c ".$1.sha1" --quiet 1>/dev/null 2>&1 && echo "already converted. remove .$1.sha1 to force" && touch "$2" && exit 0 | ||
rm -f "$2" | ||
`dirname $0`/fest2read.sh "$1" $FILE | ||
cat $FILE | text2wave -o - -eval "(audio_mode 'async)" -eval "(voice_msu_ru_nsh_clunits)" | lame --abr 16 - "$2" | ||
); | ||
rm -f $FILE | ||
|
||
[[ -f "$2" ]] && (echo ok; sha1sum "$1" "$2" > ".$1.sha1") || (echo "Error while speaking file" && exit 1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
[[ -z $1 || -z $2 ]] && echo "usage $0: input output" && exit 1 | ||
cat "$1" |sed -e s/\>//g -e s/\<//g -e s/\ \\.//g -e s/\\//\ /g -e s/–/\ /g -e s/«//g -e s/»//g | | ||
sed -e s/\ ,/,/g | | ||
sed -e s/—/-/g | | ||
sed -e s/…/\./g | | ||
sed -e s/,-/\ /g | | ||
#sed -e s/\.\.\./\ /g | | ||
sed -e s/•//g -e s/“//g -e s/”//g | | ||
sed 's/\([0-9]\),\([0-9]\)/\1\ и\ \2/g' | | ||
sed 's/\([^$\.]\)\.\([^\ ]\)/\1\.\ \2/g' | # добавляет пробел после точек, если его не было | ||
sed -e s/№/номер/g | | ||
sed -e s/www\./ввв\ точка\ /g | | ||
sed -e s/com\./\ точка\ ком/g | | ||
sed -e s/\.ru/\ точка\ ру/g | | ||
sed -e s/%/\ процентов/g -e s/т\\\.д/тд/g -e s/т\\\.п/тп/g -e s/т\\\.е\\\./то\ есть/g -e s/=/равно/g | | ||
sed -e s/д\\\.н\\\.э\\\./до\ нашей\ эры/g -e s/н\\\.э\\\./нашей\ эры/g | | ||
sed -e s/х\\\.ф\\\./художественный\ фильм/g | | ||
sed -e s/\*/a/g | | ||
# ударение | ||
sed -e s/участвовавшим/уча+ствовавши+м/g | | ||
sed -e s/Кэрролла/К+эрролла/g | | ||
sed -e s/Крайону/Край+ону/g > "$2" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/bash | ||
|
||
[[ -z $1 ]] && echo "usage $0: filename" && exit 1 | ||
TMPFILE=/tmp/saytext_ru.mp3 | ||
FILE=`mktemp` | ||
( | ||
`dirname $0`/fest2read.sh $1 $FILE | ||
`dirname $0`/convfile_ru.sh $FILE $TMPFILE | ||
padsp mplayer -ao oss $TMPFILE > /dev/null 2>&1 | ||
); | ||
rm -f $FILE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/bash | ||
# http://ru.festivalspeaker.wikia.com | ||
|
||
#echo "$1" | text2wave -o - -eval "(voice_msu_ru_nsh_clunits)" | mplayer - | ||
echo "$1" | text2wave -o /tmp/saytext_ru.wav -eval "(voice_msu_ru_nsh_clunits)" | ||
padsp mplayer -ao oss /tmp/saytext_ru.wav > /dev/null 2>&1 |