sapo/README.md

77 lines
2.1 KiB
Markdown
Raw Normal View History

2022-03-04 23:44:10 +00:00
# Sapo
A bash script that can convert txt to wav using the all powerful https://github.com/coqui-ai/TTS
2022-03-04 23:51:17 +00:00
## TTS
2022-03-04 23:44:10 +00:00
2022-03-04 23:51:17 +00:00
https://github.com/coqui-ai/TTS
2022-03-04 23:44:10 +00:00
2022-03-04 23:51:17 +00:00
### INSTALL TTS
2022-03-04 23:44:10 +00:00
2022-03-04 23:51:17 +00:00
> pip install TTS
2022-03-04 23:44:10 +00:00
2022-03-04 23:51:17 +00:00
### FIX LONG UTTERANCES PROBLEM
2022-03-04 23:44:10 +00:00
2022-03-04 23:51:17 +00:00
https://dirk.net/2021/10/31/tts-fix-max-decoder-steps/
2022-03-06 18:34:52 +00:00
2022-03-06 18:36:06 +00:00
### OTHER DEPENDENCIES
2022-03-06 18:34:52 +00:00
> sed yad sox
2022-03-06 21:50:56 +00:00
2022-03-07 00:26:43 +00:00
* 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.
2022-03-06 22:04:27 +00:00
### 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
will substitute the word _biscuit_ (or _Biscuit_ in plural) with the word _biskeet_ (_Biskeet_), that its pronunciation sounds more proper.
The list of words is growing as the script gets used more, ___<u>feel free to chime in!</u>___
2022-03-06 21:50:56 +00:00
### SCREENSHOTS
2022-03-06 23:00:19 +00:00
* File selection dialog
2022-03-06 21:50:56 +00:00
![0.png](screenshots/0.png)
---
2022-03-06 23:00:19 +00:00
* The file is delimited to lines with fewer characters each, so there will be no problem with the text-to-speech conversion due to excessively long lines. However, the user can edit the file further before thw speech conversion.
2022-03-06 21:50:56 +00:00
![1.png](screenshots/1.png)
---
![2.png](screenshots/2.png)
---
2022-03-06 23:00:19 +00:00
* Progress bar , and rough estimate of time left (probably depends on hardware)
2022-03-06 21:50:56 +00:00
![3.png](screenshots/3.png)
---
2022-03-06 23:00:19 +00:00
* Process complete, the final wav file is inside the created **Sapo_filename** folder, named **filename.wav**.
If the wav files (one for each line of text file) are too many, the final wav file
will not be produced. In this case concatetate the wav files in smaller batches ( every 500 files), and then concatenate _those_ to the final sound file, using the **sox** command, for example:
> cd Sapo_1_1.txt
>
> sox {000001..000500}.wav ~/Desktop/1f.wav
>
> sox {000501..001000}.wav ~/Desktop/2f.wav
>
> sox {001001..001500}.wav ~/Desktop/3f.wav
>
> cd ~/Desktop
>
2022-03-06 23:06:27 +00:00
> sox {1..3}f.wav final.wav
2022-03-06 23:00:19 +00:00
>
2022-03-06 23:06:27 +00:00
![4.png](screenshots/4.png)