aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/01-export-clean-audio.sh
blob: f697a33376abcda5138cef0b2afe32bb70c6ceed (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/sh

RNNOISE_MODEL="$1"

for file in files/videos/*; do

  # не обрабыватаем директории и .gitkeep-файл
  if [ ! -f "$file" ]; then
    continue
  fi
  if [ "$(basename "$file")" = ".gitkeep" ]; then
    continue
  fi

  echo "Processing $(basename $file)"

  ffmpeg \
    -v quiet -i "$file" \
    -af "arnndn=model=third-party/rnnoise-models/$RNNOISE_MODEL" \
    -f s16le -acodec pcm_s16le \
    -ar 16000 -ac 1 \
    "files/audios/$(basename "$file").raw"

done