Skip to content

Instantly share code, notes, and snippets.

@gpollo
Created July 5, 2017 01:37
Show Gist options
  • Save gpollo/3bd340c002257a3bfd210f57bfae56e4 to your computer and use it in GitHub Desktop.
Save gpollo/3bd340c002257a3bfd210f57bfae56e4 to your computer and use it in GitHub Desktop.
#!/bin/bash
if [[ -f "concatenate.raw" ]]; then
rm "concatenate.raw"
fi
find ./ -type f -iname "*.flac" | sort | while read FILE; do
printf "$FILE\n"
ffmpeg -y -i "$FILE" -f s16le -acodec pcm_s16le - >> "concatenate.raw" 2> log < /dev/null
if [[ $? -ne 0 ]]; then
cat log
exit 1
fi
printf "Status: $?\n"
done
ffmpeg -y -f s16le -ar 44.1k -ac 2 -i "concatenate.raw" "final.flac"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment