Skip to content

Instantly share code, notes, and snippets.

@thebigmunch thebigmunch/amtest.py Secret
Created Nov 11, 2018

Embed
What would you like to do?
audio-metadata test
import os
import audio_metadata
audio_filepaths = []
for root, __, files in os.walk(os.getcwd()):
for file_ in files:
filepath = os.path.join(root, file_)
with open(filepath, 'rb') as f:
if audio_metadata.determine_format(f.read(4), extension=os.path.splitext(filepath)[1]) is not None:
audio_filepaths.append(filepath)
for filepath in audio_filepaths:
try:
audio_metadata.load(filepath)
except:
print(filepath)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.