-
Notifications
You must be signed in to change notification settings - Fork 6
/
setup.sh
37 lines (30 loc) · 975 Bytes
/
setup.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
cd /audio_in/
## Now add media files to /audio_in/
for file in *.{wav,mp3,mp4,WAV,MP3,MP4}; do
if [ ${file: -4} == ".mp3" ]; then
base=$(basename """$file""" .mp3);
fi
if [ ${file: -4} == ".MP3" ]; then
base=$(basename """$file""" .MP3);
fi
if [ ${file: -4} == ".mp4" ]; then
base=$(basename """$file""" .MP4);
fi
if [ ${file: -4} == ".MP4" ]; then
base=$(basename """$file""" .MP4);
fi
if [ ${file: -4} == ".wav" ]; then
base=$(basename """$file""" .wav);
fi
if [ ${file: -4} == ".WAV" ]; then
base=$(basename """$file""" .WAV);
fi
ffmpeg -i """$file""" -ac 1 -ar 16000 """$base"""_16kHz.wav;
done
mkdir /audio_in_16khz/
mv *_16kHz.wav /audio_in_16khz/
######### Starting the batch transcription run ##########
python /kaldi/egs/american-archive-kaldi/run_kaldi.py /kaldi/egs/american-archive-kaldi/sample_experiment/ /audio_in_16khz/ && \
rsync -a /kaldi/egs/american-archive-kaldi/sample_experiment/output/ /audio_in/transcripts/
rm -r /audio_in_16khz/