(wav_audio, hparams)
return mel
Transforms the contents of a wav file into a series of mel spec frames.
Transforms the contents of a wav file into a series of mel spec frames.
Transforms the contents of a wav file into a series of mel spec frames .
def _wav_to_mel(wav_audio, hparams):
  """Transforms the contents of a wav file into a series of mel spec frames."""
  y = audio_io.wav_data_to_samples(wav_audio, hparams.sample_rate)

  mel = librosa.feature.melspectrogram(
      y,
      hparams.sample_rate,
      hop_length=hparams.spec_hop_length,
      fmin=hparams.spec_fmin,
      n_mels=hparams.spec_n_bins,
      htk=hparams.spec_mel_htk).astype(np.float32)

  # Transpose so that the data is in [frame, bins] format.
  mel = mel.T
  return mel
def _wav_to_mel ( wav_audio , hparams ) : y = audio_io . wav_data_to_samples ( wav_audio , hparams . sample_rate ) mel = librosa . feature . melspectrogram ( y , hparams . sample_rate , hop_length = hparams . spec_hop_length , fmin = hparams . spec_fmin , n_mels = hparams . spec_n_bins , htk = hparams . spec_mel_htk ) . astype ( np . float32 ) # Transpose so that the data is in [frame, bins] format. mel = mel . T return mel