update files

main
Christos Angelopoulos 2022-03-09 03:45:12 +02:00
parent ea2e4d7b5c
commit 6f7df5492c
4 changed files with 39 additions and 6 deletions

View File

@ -16,12 +16,45 @@ https://dirk.net/2021/10/31/tts-fix-max-decoder-steps/
### OTHER DEPENDENCIES
> sed yad sox
> sudo apt install sed yad sox jq
* As a text editor I use xed. If you prefer, however, another text editor by default (gedit, geany, mousepad etc), please substitute __xed__ in _line 82_ of __Sapo.sh__ with the respective command of your preffered editor.
* As a text editor I use _xed_. If you prefer, however, another text editor by default (gedit, geany, mousepad etc), please substitute __xed__ in _line 82_ of __Sapo.sh__ with the respective command of your preffered editor.
* Likewise, instead of _celluloid_ audio player, you can use any other player you prefer, like _xplayer, mplayer, smplayer, vlc, mpv etc._ Just make sure to substitute celluloid with your preffered player in line 211 of __Sapo.sh__.
* The same applies for _Audacity_ and any other preffred wave editor in line 222 of Sapo.sh. While _audacity_ is not considered an absolute dependency for the functionality of the script, having a wave editor installed might as well be of use in cases, so, such a choice exists in fixing potential errors.
### DETECTING ERRORS
### I. CLATTER IN AUDIO OUTPUT
Sometimes the output wav file of a text file line is longer than necessary, containing hissing sounds, inrecognisable utterrances and clatter at the end of it. In order to detect which wave files are generated having that problem, the ratio of _character count of line / duration of audio file_
is calculated. The lines that _possibly_ present this problem are written down in the error.tsv that is generated. After the end of all the lines,
* the lines written down in the tsv file get re-rendered. Many times this alone is enough.
* After that each line one by one can be examined. The user can
> 1.__Play__ the respective audio file
>2.__Re-render__ the line, making minor changes(like e.g. putting a fullstop at the end of the line)
### SED SCRIPT
>3.__Trim the clutter__ that exists at the end of audio file, anything that exists after half a second of detected silence.
>4.__Split__ render the line text in two batches, that will be concatenated after(useful in long sentences)
>5.__Edit__ the respective audio file with a wave editor(e.g._Audacity)
>6.__Remove__ the respective audio file directly.
>7.By hiting __OK__ the user vcan accept the audio file as is, or after correcting it, and proceed to the next.
![5.png](screenshots/5.png)
After that, the audio files from all the lines will be concatenated into one.
### II. SED SCRIPT
sapofonetix.sed is a script that substitutes words that get mispelled with other letter combinations, that have the right pronunciation result, e.g.
> s/biscuit/biskit/g;s/Biscuit/biskit/g

View File

@ -192,7 +192,7 @@ do
--button=gtk-cancel:1 \
--button='▶Play Audio':2 \
--button='🔄Re-Render':3 \
--button='✂Trim Junk':4 \
--button='✂Trim Clutter':4 \
--button='🔪Split-Render':5 \
--button='🎵Edit audio':7 \
--button='❌Remove audio':6 \
@ -217,7 +217,7 @@ do
;;
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
;;
6) rm "$DIRECTORY""Sapo_""$NAME"/$ERROR_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
;;
7)audacity "$DIRECTORY""Sapo_""$NAME"/$ERROR_WAV
;;

View File

@ -32,7 +32,7 @@ do
--button=gtk-cancel:1 \
--button='▶Play Audio':2 \
--button='🔄Re-Render':3 \
--button='✂Trim Junk':4 \
--button='✂Trim Clutter':4 \
--button='🔪Split-Render':5 \
--button='🎵Edit audio':7 \
--button='❌Remove audio':6 \

BIN
screenshots/5.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 137 KiB