Created
January 1, 2022 15:50
-
-
Save packerdl/91d55310ea59859452b40c0925e39abb to your computer and use it in GitHub Desktop.
Calculate hash of FLAC audio stream with FFMPEG
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env bash | |
# This converts each flac file in a given folder into a raw PCM bit stream. | |
# The raw bit stream can be used to perform a metadata-agnostic comparison | |
# with other audio streams. | |
for file in *.flac; do | |
# -ar = sampling rate | |
# -ac = number of audio channels | |
# -f = sample format (s16le = 16bit, little-endian) | |
ffmpeg -i "$file" -loglevel error -ar 44100 -ac 2 -f s16le "$file.pcm" | |
md5sum "$file.pcm" | |
rm "$file.pcm" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment