summaryrefslogtreecommitdiff
path: root/cut_by_vtt.sh
diff options
context:
space:
mode:
Diffstat (limited to 'cut_by_vtt.sh')
-rwxr-xr-xcut_by_vtt.sh15
1 files changed, 10 insertions, 5 deletions
diff --git a/cut_by_vtt.sh b/cut_by_vtt.sh
index ceb58cb..4bbd13e 100755
--- a/cut_by_vtt.sh
+++ b/cut_by_vtt.sh
@@ -2,21 +2,26 @@
set -e
-filename=${1:-}
-audioname=$(printf "$filename" | sed "s/\(.*\).vtt/\1/")
+filepath=${1:-}
+audioname=$(printf "$filepath" | sed "s/\(.*\).vtt/\1/")
+filename=$(basename "$audioname")
-outdir=$(dirname "$filename")/utterances
+outdir=/mnt/desktop/media/datasets/nesfatelp_voice/utterances
+# outdir=$(dirname "$filepath")/utterances
mkdir -p "$outdir"
+
# given vtt what is original ext?
-ffmpeg_commands=$(grep "\-->" $filename | awk -F " " \
+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" \
- " -vn -acodec copy " outdir "/" $1"_"$3 ".ogg"}')
+ " -ar 22050 " outdir "/" bname"_" $1"_"$3 ".wav"}')
while read cline;
do
echo $cline && sleep 1;
+ eval $cline && sleep 1;
done <<< $ffmpeg_commands