blob: 4bbd13e411117438621c0cae9ba7490c45f305fc (
plain)
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
|
#!/bin/sh
set -e
filepath=${1:-}
audioname=$(printf "$filepath" | sed "s/\(.*\).vtt/\1/")
filename=$(basename "$audioname")
outdir=/mnt/desktop/media/datasets/nesfatelp_voice/utterances
# outdir=$(dirname "$filepath")/utterances
mkdir -p "$outdir"
# given vtt what is original ext?
ffmpeg_commands=$(grep "\-->" $filepath | awk -F " " \
-v aname="$audioname" \
-v bname="$filename" \
-v outdir="$outdir" \
'{print "ffmpeg -i "aname" -ss " $1 " -to " $3 \
" -metadata text_source=" aname ".vtt" \
" -ar 22050 " outdir "/" bname"_" $1"_"$3 ".wav"}')
while read cline;
do
echo $cline && sleep 1;
eval $cline && sleep 1;
done <<< $ffmpeg_commands
|