code: def extract_mel_partials(self, wav):
      wav_slices, mel_slices = compute_partial_slices(
          len(wav),
          self.partial_n_frames,
          self.hop_length,
          self.min_pad_coverage,
          self.partial_overlap_ratio,
      )
  
      # pad audio if needed
      max_wave_length = wav_slices[-1].stop
      if max_wave_length >= len(wav):
          wav = np.pad(wav, (0, max_wave_length - len(wav)), "constant")
  
      # Split the utterance into partials
      frames = self.melspectrogram(wav)
      frames_batch = np.array([frames[s] for s in mel_slices])
      return frames_batch
  
file_path: PaddleHub/modules/audio/voice_cloning/lstm_tacotron2/audio_processor.py
imports: from pathlib import Path
  from warnings import warn
  import struct
  from scipy.ndimage.morphology import binary_dilation
  import numpy
  import librosa
label_desc: Use image node_id 4 for calling the SpeakerVerificationPreprocessor obj's underlying member method code with example usage: obj.extract_mel_partials(wav) and returns: frames_batch