Closed bitsgalore closed 7 years ago
Update:
audioFile = os.path.normpath("E:/detectDamagedAudio/data/frogs-01-last-byte-missing.wav")
audio = AudioSegment.from_file(audioFile, "wave")
print(audio.channels)
print(audio.frame_rate)
print(audio.sample_width*8) # sample width = bit depth in bytes!
This does not result in any error message or warnings, so pydub not suitable for detecting broken audio (results same for FLAC). Pydub could be used for extracting no. of channels, bit depth and sampling rate.
Installation: ignore conda instructions on http://pysoundfile.readthedocs.io/en/0.9.0/, and just use pip:
pip install CFFI
pip install NumPy
pip install pysoundfile
Appears to detect broken FLACs but doesn't detect broken WAV files!
Done (using wrapper functions for shntool and flac): https://github.com/KBNLresearch/iromlab/commit/a0e01e20f70c5c79f160caa5843d1dafd1e64e35
Either use external tool:
http://openpreservation.org/blog/2017/01/04/breaking-waves-and-some-flacs/
Or maybe this (needs testing):
https://docs.python.org/3.6/library/wave.html
Or (supports FLAC!):http://audiotools.sourceforge.net/
Especially:
http://audiotools.sourceforge.net/programming/audiotools.html#audiotools.AudioFile.verify
Audiotools installation fail under Windows! Other possibilities (?):
Libav binaries link in Pudub doc is outdated; new link:
http://builds.libav.org/windows/