fsicoli's picture
Upload folder using huggingface_hub (#152)
825ae3d
raw
history blame
401 Bytes
#!/bin/bash
TOTAL_TIME=0
for TRACK in *.mp3; do
echo Reading "${TRACK}"
TRACK_TIME="$(soxi -D "${TRACK}" 2>/dev/null)"
[[ "$TRACK_TIME" != "" ]] && TOTAL_TIME="$TOTAL_TIME + $TRACK_TIME"
TOTAL_TIME=$(echo "$TOTAL_TIME" | bc)
done
echo ''
echo -n "Total Duration (in seconds): "
echo "${TOTAL_TIME}"
# echo -n "Average Clip Duration (in seconds): "
# echo "${TOTAL_TIME}/${LEN}" | bc