fishtalk/tools/convert.sh

17 lines
346 B
Bash
Raw Normal View History

2026-05-23 12:19:22 +09:00
#!/bin/sh
cd ../samples_old
for i in *.wav; do
2026-05-23 12:59:16 +09:00
n=50
2026-05-23 12:19:22 +09:00
b=""
echo "$i"
while true; do
2026-05-23 14:08:06 +09:00
if ( ffmpeg -y -i $b$i -af silenceremove=1:0:-${n}dB:stop_periods=1:stop_duration=0:stop_threshold=-${n}dB -ar 11025 -ac 1 ../fishtalk/samples/$i 2>&1 | grep "empty" ); then
2026-05-23 12:19:22 +09:00
n=`expr $n + 10`
2026-05-23 14:08:06 +09:00
b="../samples_older/"
2026-05-23 12:19:22 +09:00
continue
fi
break
done
done