Skip to content

Commit

Permalink
chore: friendly error report
Browse files Browse the repository at this point in the history
  • Loading branch information
magic-akari committed Jul 14, 2023
1 parent 39a9ffc commit e7b4785
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions data_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,9 @@ def get_audio(self, filename):
filename = filename.replace("\\", "/")
audio, sampling_rate = load_wav_to_torch(filename)
if sampling_rate != self.sampling_rate:
raise ValueError("{}: {} SR doesn't match target {} SR".format(
filename, sampling_rate, self.sampling_rate))
raise ValueError(
"Sample Rate not match. Expect {} but got {} from {}".format(
self.sampling_rate, sampling_rate, filename))
audio_norm = audio / self.max_wav_value
audio_norm = audio_norm.unsqueeze(0)
spec_filename = filename.replace(".wav", ".spec.pt")
Expand Down

0 comments on commit e7b4785

Please sign in to comment.