Files
sumsel/convert.sh
2021-01-30 10:25:23 +00:00

20 lines
480 B
Bash
Executable File

#!/bin/bash
. ./sumsel.conf
#Alle WAV Files ausser das letzte File.
#Das letzte File wird gerade recorded und wird beim naechsten Durchlauf verarbeitet
FILES=$(ls -tr ${REC_DIR} |head -n -1)
for F in ${FILES}
do
#echo ${F}
#Ermittle ctime des WAV Files
CTIME=$(date -r "${REC_DIR}/${F}" +"%Y%m%d%H%M%S")
ffmpeg -i "${REC_DIR}/${F}" -acodec mp3 "${UPL_DIR}/${CTIME}_${UP_SUFFIX}.mp3"
rm "${REC_DIR}/${F}"
done
rsync -avzh --remove-source-files ${UPL_DIR} ${REMOTE_DIR}