-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtts.sh
37 lines (23 loc) · 1.02 KB
/
tts.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/bash
# Create a new directory for the .wav files
mkdir -p audioFiles/
# Create a new directory for the .wav files
mkdir -p audioFiles/$(date '+%d.%m.20%y-wav')/
# Change to the directory where the .txt files are located
cd txtFiles/$(date '+%d.%m.20%y-txt')/
#Loop through each .txt file in the directory
#for file in *.txt
#do
#larynx -v en-us/cmu_ahw-glow_tts --raw-stream < "$file" | ffmpeg -f s16le -ar 22050 -ac 1 -i - -codec:a libmp3lame -qscale:a 2 ../../audioFiles/"$(date '+%d.%m.20%y-wav')/${file%.*}.mp3"
#done
#Loop through each .txt file in the directory
for file in *.txt
do
larynx -v cmu_fem --length-scale 1.1 --raw-stream < "$file" | ffmpeg -f s16le -ar 22050 -ac 1 -i - -codec:a libmp3lame -qscale:a 2 ../../audioFiles/"$(date '+%d.%m.20%y-wav')/${file%.*}.mp3" &
pid=$!
wait $pid
done
# To dziaua
#larynx -v en --raw-stream < txtFiles/13.04.2023-txt/3-drunk-guys-entered-a-taxi.txt | ffmpeg -f s16le -ar 22050 -ac 1 -i - -codec:a libmp3lame -qscale:a 2 audioFiles/output.mp3
cd ../../
pwd