Skip to content

Commit

Permalink
Merge pull request #50 from UsernamesLame/main
Browse files Browse the repository at this point in the history
re-add "unnecessary" normalization to fix UTF-8 errors.
  • Loading branch information
abdeladim-s committed Aug 31, 2024
2 parents 4df7cfc + ee19adc commit 8a759cc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pywhispercpp/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 8a759cc

Please sign in to comment.