Skip to content

Commit

Permalink
Mirroring touchhowling's PR CorentinJ#1290
Browse files Browse the repository at this point in the history
  • Loading branch information
dmgolembiowski committed Jun 17, 2024
1 parent 911679d commit df47562
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions encoder/audio.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def preprocess_wav(fpath_or_wav: Union[str, Path, np.ndarray],

# Resample the wav if needed
if source_sr is not None and source_sr != sampling_rate:
wav = librosa.resample(wav, source_sr, sampling_rate)
wav = librosa.resample(wav, orig_sr=source_sr, target_sr=sampling_rate)

# Apply the preprocessing: normalize volume and shorten long silences
if normalize:
Expand All @@ -56,8 +56,8 @@ def wav_to_mel_spectrogram(wav):
Note: this not a log-mel spectrogram.
"""
frames = librosa.feature.melspectrogram(
wav,
sampling_rate,
y=wav,
sr=sampling_rate,
n_fft=int(sampling_rate * mel_window_length / 1000),
hop_length=int(sampling_rate * mel_window_step / 1000),
n_mels=mel_n_channels
Expand Down

0 comments on commit df47562

Please sign in to comment.