We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d2d9c34 commit d5441f4Copy full SHA for d5441f4
precise/util.py
@@ -46,9 +46,10 @@ def load_audio(file: Any) -> np.ndarray:
46
samples: Sample rate and audio samples from 0..1
47
"""
48
import wavio
49
+ import wave
50
try:
51
wav = wavio.read(file)
- except EOFError:
52
+ except (EOFError, wave.Error):
53
wav = wavio.Wav(np.array([[]], dtype=np.int16), 16000, 2)
54
if wav.data.dtype != np.int16:
55
raise InvalidAudio('Unsupported data type: ' + str(wav.data.dtype))
0 commit comments