File size: 826 Bytes
a361db3 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | import soundfile as sf
import sys
files = [
"output/analysis_example_frankenstein/talker_of_interest.wav",
"output/analysis_example_frankenstein/talker_of_interest_enhanced.wav",
"output/analysis_frankenstein/talker_of_interest.wav",
"output/analysis_frankenstein/talker_of_interest_enhanced.wav",
]
all_valid = True
for file in files:
try:
data, sr = sf.read(file)
duration = len(data) / sr
print(f"✓ {file}")
print(f" - Sample rate: {sr} Hz")
print(f" - Duration: {duration:.2f}s")
print(f" - Samples: {len(data)}")
except Exception as e:
print(f"✗ {file}: {e}")
all_valid = False
if all_valid:
print("\n✅ All audio files valid")
sys.exit(0)
else:
print("\n❌ Audio validation failed")
sys.exit(1)
|