update scripts

main
Christos Angelopoulos 2022-03-23 01:10:34 +02:00
parent dc75f3f479
commit 83b793a7e2
2 changed files with 12 additions and 11 deletions

11
Sapo.sh
View File

@ -30,7 +30,6 @@ sed "s/—/\,\n/g;
s/^ *//g;
s/^\;$//g;
s/^\.$//g;
s/^'//g;
s/\…/\,/g;
s/\/\'/g;
s/(/\,\n(/g;
@ -74,8 +73,10 @@ do
echo "Task completed for line "$DELIM
((DELIM--))
done
####################### substitute Ey =>A and Eye=>I at beggining of line
####################### Extra substituutions
sed -i "s/^ *\<Ey\>/A/g;s/^ *\<Eye\>/I/g" "$DIRECTORY""Sapo_""$NAME"/"$NAME"sentenced.txt
sed -i "s/^ *'//g;s/^'//g;s/^ *//g;s/^//g " "$DIRECTORY""Sapo_""$NAME"/"$NAME"sentenced.txt
sed -i "/^$/d" "$DIRECTORY""Sapo_""$NAME"/"$NAME"sentenced.txt #get rid of empty lines
########################################
yad --image "$HOME/git/sapo/sapo.png" --height=40 --width=400 --title="${NAME} - Sapo" --button=gtk-cancel:1 --button=gtk-open:2 --button=gtk-ok:0 --text="The text is prepared, Press:
1. <span foreground='yellow'><b>Open </b></span>to edit the new file
@ -180,13 +181,13 @@ done
--image "$HOME/git/sapo/sapo_progress.png" \
--auto-close
####### FIXING ERRORS ONE BY ONE or EDIT THE FILE LINE BY LINE############
yad --image "$HOME/git/sapo/sapo-fix.png" \
yad --image "$HOME/git/sapo/sapo.png" \
--height=40 --width=200 --title="${NAME} - Sapo" \
--text="Which lines do you want to fix?" \
--button=gtk-cancel:1 \
--button='All Lines':2 \
--button='Just Errors':3 \
--window-icon=$HOME/git/sapo/sapo-fix.png
--window-icon=$HOME/git/sapo/sapo.png
case $? in
1) exit
;;
@ -254,7 +255,7 @@ do
;;
5)s="$(yad --entry --width="600" --text="Split the printed text roughly in half with the pipe symbol (|), so that it can be rendered in two batches: " --entry-text="$TEXT_TO_CORRECT" --window-icon=$HOME/git/sapo/sapo.png --title="Line $ERROR_TEXT_LINE - $NAME")";s1="$(echo $s|sed 's/|.*$//')";s2="$(echo $s|sed 's/^.*|//')"; echo $s1;echo $s2 ; tts --text "$s1" --out_path "$DIRECTORY""Sapo_""$NAME"/1temp.wav; tts --text "$s2" --out_path "$DIRECTORY""Sapo_""$NAME"/2temp.wav;sox "$DIRECTORY""Sapo_""$NAME"/1temp.wav "$DIRECTORY""Sapo_""$NAME"/2temp.wav "$DIRECTORY""Sapo_""$NAME"/$ERROR_WAV ; rm "$DIRECTORY""Sapo_""$NAME"/1temp.wav "$DIRECTORY""Sapo_""$NAME"/2temp.wav
;;
6) if [[ -e "$DIRECTORY""Sapo_""$NAME"/$ERROR_WAV ]];then rm "$DIRECTORY""Sapo_""$NAME"/$ERROR_WAV;notify-send "$DIRECTORY""Sapo_""$NAME"/"$ERROR_WAV"" has been deleted."; else notify-send "There is no file ""$DIRECTORY""Sapo_""$NAME"/"$ERROR_WAV"". Already deleted?";fi
6) if [[ -e "$DIRECTORY""Sapo_""$NAME"/$ERROR_WAV ]];then rm "$DIRECTORY""Sapo_""$NAME"/$ERROR_WAV;notify-send "$DIRECTORY""Sapo_""$NAME"/"$ERROR_WAV"" has been deleted."; else notify-send "There is no file ""$DIRECTORY""Sapo_""$NAME"/"$ERROR_WAV"". Already deleted?";fi;GO=true
;;
7)audacity "$DIRECTORY""Sapo_""$NAME"/$ERROR_WAV
;;

View File

@ -22,13 +22,13 @@ esac
DIRECTORY=${FILE%/*}/
NAME=${FILE##*/}
####### FIXING ERRORS ONE BY ONE or EDIT THE FILE LINE BY LINE############
yad --image "$HOME/git/sapo/sapo-fix.png" \
yad --image "$HOME/git/sapo/sapo.png" \
--height=40 --width=200 --title="${NAME} - Sapo" \
--text="Which lines do you want to fix?" \
--button=gtk-cancel:1 \
--button='All Lines':2 \
--button='Just Errors':3 \
--window-icon=$HOME/git/sapo/sapo-fix.png
--window-icon=$HOME/git/sapo/sapo.png
case $? in
1) exit
;;
@ -66,7 +66,7 @@ do
do
yad --image "$HOME/git/sapo/sapo.png" \
--height=40 --width=400 \
--title="Line $ERROR_TEXT_LINE - $NAME" \
--title="Line $ERROR_TEXT_LINE ( of $TOTAL_ERRORS )- $NAME" \
--button=gtk-cancel:1 \
--button='▶️ Play Audio':2 \
--button='🔃 Re-Render':3 \
@ -76,7 +76,7 @@ do
--button='❌ Remove audio':6 \
--button='⬅️ Previous Line':8 \
--button='➡️ Next Line':0 \
--text="Text of line $ERROR_TEXT_LINE (of $TOTAL_ERRORS):
--text="Text of line $ERROR_TEXT_LINE ( of $TOTAL_ERRORS ):
<span foreground='yellow'><b>$TEXT_TO_CORRECT</b></span>
@ -96,7 +96,7 @@ do
;;
5)s="$(yad --entry --width="600" --text="Split the printed text roughly in half with the pipe symbol (|), so that it can be rendered in two batches: " --entry-text="$TEXT_TO_CORRECT" --window-icon=$HOME/git/sapo/sapo.png --title="Line $ERROR_TEXT_LINE - $NAME")";s1="$(echo $s|sed 's/|.*$//')";s2="$(echo $s|sed 's/^.*|//')"; echo $s1;echo $s2 ; tts --text "$s1" --out_path "$DIRECTORY""Sapo_""$NAME"/1temp.wav; tts --text "$s2" --out_path "$DIRECTORY""Sapo_""$NAME"/2temp.wav;sox "$DIRECTORY""Sapo_""$NAME"/1temp.wav "$DIRECTORY""Sapo_""$NAME"/2temp.wav "$DIRECTORY""Sapo_""$NAME"/$ERROR_WAV ; rm "$DIRECTORY""Sapo_""$NAME"/1temp.wav "$DIRECTORY""Sapo_""$NAME"/2temp.wav
;;
6) if [[ -e "$DIRECTORY""Sapo_""$NAME"/$ERROR_WAV ]];then rm "$DIRECTORY""Sapo_""$NAME"/$ERROR_WAV;notify-send "$DIRECTORY""Sapo_""$NAME"/"$ERROR_WAV"" has been deleted."; else notify-send "There is no file ""$DIRECTORY""Sapo_""$NAME"/"$ERROR_WAV"". Already deleted?";fi
6) if [[ -e "$DIRECTORY""Sapo_""$NAME"/$ERROR_WAV ]];then rm "$DIRECTORY""Sapo_""$NAME"/$ERROR_WAV;notify-send "$DIRECTORY""Sapo_""$NAME"/"$ERROR_WAV"" has been deleted."; else notify-send "There is no file ""$DIRECTORY""Sapo_""$NAME"/"$ERROR_WAV"". Already deleted?";fi;GO=true
;;
7)audacity "$DIRECTORY""Sapo_""$NAME"/$ERROR_WAV
;;
@ -106,4 +106,4 @@ do
((ERROR_LINE++))
done
sox "$DIRECTORY""Sapo_""$NAME"/*.wav "$DIRECTORY""Sapo_""$NAME"/"$NAME".wav
yad --image "$HOME/git/sapo/sapo-fix.png" --height=40 --width=400 --title="${NAME} - Sapo" --text="Reading of ""$NAME"" is complete!" --window-icon=$HOME/git/sapo/sapo-fix.png
yad --image "$HOME/git/sapo/sapo.png" --height=40 --width=400 --title="${NAME} - Sapo" --text="Reading of ""$NAME"" is complete!" --window-icon=$HOME/git/sapo/sapo.png