mirror of https://gitlab.com/christosangel/sapo
update files
parent
cc905239a1
commit
2122047208
42
Sapo.sh
42
Sapo.sh
|
@ -1,7 +1,12 @@
|
|||
#! /bin/bash
|
||||
#┏━┓┏━┓┏━┓┏━┓
|
||||
#┗━┓┣━┫┣━┛┃ ┃
|
||||
#┗━┛╹ ╹╹ ┗━┛
|
||||
# ▗▄▖
|
||||
#▗▛▀▜
|
||||
#▐▙ ▟██▖▐▙█▙ ▟█▙
|
||||
# ▜█▙ ▘▄▟▌▐▛ ▜▌▐▛ ▜▌
|
||||
# ▜▌▗█▀▜▌▐▌ ▐▌▐▌ ▐▌
|
||||
#▐▄▄▟▘▐▙▄█▌▐█▄█▘▝█▄█▘
|
||||
# ▀▀▘ ▀▀▝▘▐▌▀▘ ▝▀▘
|
||||
# ▐▌
|
||||
# a tts bash script by Christos Angelopoulos, February 2022
|
||||
#converts txt to wav
|
||||
#using the all powerful https://github.com/coqui-ai/TTS
|
||||
|
@ -131,11 +136,11 @@ do
|
|||
((LINE++))
|
||||
done
|
||||
) |
|
||||
yad --progress --height="40" --width="400" \
|
||||
yad --progress --height="40" \
|
||||
--title="Sapo - Reading . . . ${NAME}" \
|
||||
--percentage=0 \
|
||||
--height=40 \
|
||||
--width=500 \
|
||||
--width="500" \
|
||||
--window-icon=$HOME/git/sapo/sapo.png \
|
||||
--image "$HOME/git/sapo/sapo_progress.png" \
|
||||
--auto-close
|
||||
|
@ -166,11 +171,11 @@ do
|
|||
((ERROR_LINE++))
|
||||
done
|
||||
)|
|
||||
yad --progress --height="40" --width="400" \
|
||||
yad --progress --height="40" \
|
||||
--title="Sapo - Fixing Errors . . . ${NAME}" \
|
||||
--percentage=0 \
|
||||
--height=40 \
|
||||
--width=500 \
|
||||
--width="500" \
|
||||
--window-icon=$HOME/git/sapo/sapo.png \
|
||||
--image "$HOME/git/sapo/sapo_progress.png" \
|
||||
--auto-close
|
||||
|
@ -187,19 +192,20 @@ do
|
|||
while [[ $GO == false ]]
|
||||
do
|
||||
yad --image "$HOME/git/sapo/sapo.png" \
|
||||
--height=40 --width=400 \
|
||||
--title="Line $ERROR_TEXT_LINE - $NAME" \
|
||||
--button=gtk-cancel:1 \
|
||||
--button='▶️Play Audio':2 \
|
||||
--button='🔃Re-Render':3 \
|
||||
--button='✂️Trim Clutter':4 \
|
||||
--button='🗡Split-Render':5 \
|
||||
--button='🎵Edit audio':7 \
|
||||
--button='❌Remove audio':6 \
|
||||
--button='😃Keep':0 \
|
||||
--button='▶️ Play Audio':2 \
|
||||
--button='🔃 Re-Render':3 \
|
||||
--button='✂️ Trim Clutter':4 \
|
||||
--button='🗡 Split-Render':5 \
|
||||
--button='🎵 Edit audio':7 \
|
||||
--button='❌ Remove audio':6 \
|
||||
--button='😃 Keep/Next':0 \
|
||||
--text="Text of line $ERROR_TEXT_LINE :
|
||||
|
||||
|
||||
$TEXT_TO_CORRECT
|
||||
<span foreground='yellow'><b>$TEXT_TO_CORRECT</b></span>
|
||||
|
||||
|
||||
-What would you like to do?" \
|
||||
--window-icon=$HOME/git/sapo/sapo.png
|
||||
|
@ -210,12 +216,12 @@ $TEXT_TO_CORRECT
|
|||
;;
|
||||
2) celluloid "$DIRECTORY""Sapo_""$NAME"/$ERROR_WAV
|
||||
;;
|
||||
3) s="$(yad --entry --text="This is the original text of the line $ERROR_TEXT_LINE.
|
||||
3) s="$(yad --entry --width="600" --text="This is the original text of the line $ERROR_TEXT_LINE.
|
||||
Edit as you wish, then hit OK to render." --entry-text="$TEXT_TO_CORRECT" --window-icon=$HOME/git/sapo/sapo.png --title="Line $ERROR_TEXT_LINE - $NAME")";tts --text "$s" --out_path "$DIRECTORY""Sapo_""$NAME"/$ERROR_WAV
|
||||
;;
|
||||
4)sox -V3 "$DIRECTORY""Sapo_""$NAME"/$ERROR_WAV "$DIRECTORY""Sapo_""$NAME"/temp.wav silence 1 0.50 0.1% 1 0.5 0.1%;sox "$DIRECTORY""Sapo_""$NAME"/temp.wav "$DIRECTORY""Sapo_""$NAME"/$ERROR_WAV pad 0 0.5;rm "$DIRECTORY""Sapo_""$NAME"/temp.wav
|
||||
;;
|
||||
5)s="$(yad --entry --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
|
||||
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
|
||||
;;
|
||||
|
|
31
sapo-fix.sh
31
sapo-fix.sh
|
@ -1,7 +1,14 @@
|
|||
#!/bin/bash
|
||||
#┏━┓┏━┓┏━┓┏━┓ ┏━╸╻╻ ╻
|
||||
#┗━┓┣━┫┣━┛┃ ┃╺━╸┣╸ ┃┏╋┛
|
||||
#┗━┛╹ ╹╹ ┗━┛ ╹ ╹╹ ╹
|
||||
#
|
||||
# ▗▄▖ ▄▄ █
|
||||
#▗▛▀▜ ▐▛▀ ▀
|
||||
#▐▙ ▟██▖▐▙█▙ ▟█▙ ▐███ ██ ▝█ █▘
|
||||
# ▜█▙ ▘▄▟▌▐▛ ▜▌▐▛ ▜▌ ▐▌ █ ▐█▌
|
||||
# ▜▌▗█▀▜▌▐▌ ▐▌▐▌ ▐▌ ██▌ ▐▌ █ ▗█▖
|
||||
#▐▄▄▟▘▐▙▄█▌▐█▄█▘▝█▄█▘ ▐▌ ▗▄█▄▖ ▟▀▙
|
||||
# ▀▀▘ ▀▀▝▘▐▌▀▘ ▝▀▘ ▝▘ ▝▀▀▀▘▝▀ ▀▘
|
||||
# ▐▌
|
||||
#
|
||||
# a tts bash script by Christos Angelopoulos, February 2022
|
||||
#Attempts to fix errors in wav files generated by sapo.sh (txt to wav)
|
||||
#using the all powerful https://github.com/coqui-ai/TTS
|
||||
|
@ -30,19 +37,19 @@ do
|
|||
--height=40 --width=400 \
|
||||
--title="Line $ERROR_TEXT_LINE - $NAME" \
|
||||
--button=gtk-cancel:1 \
|
||||
--button='▶️Play Audio':2 \
|
||||
--button='🔃Re-Render':3 \
|
||||
--button='✂️Trim Clutter':4 \
|
||||
--button='🗡Split-Render':5 \
|
||||
--button='🎵Edit audio':7 \
|
||||
--button='❌Remove audio':6 \
|
||||
--button='😃Keep':0 \
|
||||
--button='▶️ Play Audio':2 \
|
||||
--button='🔃 Re-Render':3 \
|
||||
--button='✂️ Trim Clutter':4 \
|
||||
--button='🗡 Split-Render':5 \
|
||||
--button='🎵 Edit audio':7 \
|
||||
--button='❌ Remove audio':6 \
|
||||
--button='😃 Keep/Next':0 \
|
||||
--text="Text of line $ERROR_TEXT_LINE :
|
||||
|
||||
$TEXT_TO_CORRECT
|
||||
<span foreground='yellow'><b>$TEXT_TO_CORRECT</b></span>
|
||||
|
||||
-What would you like to do?" \
|
||||
--window-icon=$HOME/git/sapo/sapo-fix.png
|
||||
--window-icon=$HOME/git/sapo/sapo.png
|
||||
case $? in
|
||||
0) GO=true
|
||||
;;
|
||||
|
|
Loading…
Reference in New Issue