CorentinJ / Real-Time-Voice-Cloning

Clone a voice in 5 seconds to generate arbitrary speech in real-time
Other
51.65k stars 8.66k forks source link

melspectrogram() error #1176

Open tony2023 opened 1 year ago

tony2023 commented 1 year ago

On ubuntu 22.04 when I run the demo_cli.py, I got this:

melspectrogram() takes 0 positional arguments but 2 positional arguments.

eminser commented 1 year ago

Change the relevant function like this:

def wav_to_mel_spectrogram(wav): """ Derives a mel spectrogram ready to be used by the encoder from a preprocessed audio waveform. Note: this not a log-mel spectrogram. """ frames = librosa.feature.melspectrogram( y=wav, # changed row sr=sampling_rate, # changed row n_fft=int(sampling_rate mel_window_length / 1000), hop_length=int(sampling_rate mel_window_step / 1000), n_mels=mel_n_channels ) return frames.astype(np.float32).T

LucasCoraca commented 1 year ago

Can confirm that this works

eminser commented 1 year ago

Yes, it works fine for me. I think this issue is for the new release of Librosa. Librosa wants parameters with names.

OrelSokolov commented 1 year ago

@tony2023 I've got almost the same issue at Windows, conda version change of librosa fixed this, but demo_toolbox.py still not running...

ajay-sampath commented 1 year ago

use librosa vesrion 0.9.2 the issue will be sorted

philfranc commented 1 year ago

Thanks to ajay-sampath It works with librosa 0.9.2 Command: pip install librosa==0.9.2

matcarpes commented 10 months ago

Thanks for the tip! I had the following error with the melspectrogram function:

TypeError: melspectrogram() takes 0 positional arguments but 1 positional argument (and 1 keyword-only argument) were given

Installing librosa 0.9.2 fixed it