Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MelSpectrogram() and unspecified sampling rate #74

Open
dsplog opened this issue May 5, 2024 · 1 comment
Open

MelSpectrogram() and unspecified sampling rate #74

dsplog opened this issue May 5, 2024 · 1 comment

Comments

@dsplog
Copy link

dsplog commented May 5, 2024

in the meldataset.py, could see that all wav files are resampled to 24000sps. however, as the MelSpectrogram() transform is called without sample_rate argument defaults to 16000sps.

to_mel = torchaudio.transforms.MelSpectrogram(
    n_mels=80, n_fft=2048, win_length=1200, hop_length=300)
mean, std = -4, 4

def preprocess(wave):
    wave_tensor = torch.from_numpy(wave).float()
    mel_tensor = to_mel(wave_tensor)
    mel_tensor = (torch.log(1e-5 + mel_tensor.unsqueeze(0)) - mean) / std
    return mel_tensor

questions :

  1. believe 2400sps (vs 16000sps needed) was an oversight ?
  2. also, how was the mean/std of -4, 4 arrived.
@gnitoah
Copy link

gnitoah commented Sep 7, 2024

yl4579/StarGANv2-VC#10 and #57, should be helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants