diff --git a/pywhispercpp/model.py b/pywhispercpp/model.py index be73b94..8742bba 100644 --- a/pywhispercpp/model.py +++ b/pywhispercpp/model.py @@ -273,7 +273,7 @@ def _load_audio(media_file_path: str) -> np.array: sound = AudioSegment.from_file(media_file_path) sound = sound.set_frame_rate(constants.WHISPER_SAMPLE_RATE).set_channels(1) arr = np.array(sound.get_array_of_samples()).T.astype(np.float32) - arr /= np.iinfo(samples[0].typecode).max + arr /= np.iinfo(np.int16).max return arr def __del__(self):