code: def __call__(self, path):
      # load data with trimming and normalizing
      raw, _ = librosa.load(path, self.sr, res_type="kaiser_fast")
      raw, _ = librosa.effects.trim(raw, self.top_db)
      raw /= numpy.abs(raw).max()
      raw = raw.astype(numpy.float32)
  
      # mu-law transform
      quantized = self.mu_law.transform(raw)
  
      # padding/triming
      if self.length is not None:
          if len(raw) <= self.length:
              # padding
              pad = self.length - len(raw)
              raw = numpy.concatenate(
                  (raw, numpy.zeros(pad, dtype=numpy.float32))
              )
              quantized = numpy.concatenate(
                  (quantized, self.quantize // 2 * numpy.ones(pad))
              )
              quantized = quantized.astype(numpy.int32)
          else:
              # triming
              start = random.randint(0, len(raw) - self.length - 1)
              raw = raw[start : start + self.length]
              quantized = quantized[start : start + self.length]
  
      # calculate mel-spectrogram
      spectrogram = librosa.feature.melspectrogram(
          raw,
          self.sr,
          n_fft=self.n_fft,
          hop_length=self.hop_length,
          n_mels=self.n_mels,
      )
      spectrogram = librosa.power_to_db(spectrogram, ref=numpy.max)
  
      # normalize mel spectrogram into [-1, 1]
      spectrogram += 40
      spectrogram /= 40
      if self.length is not None:
          spectrogram = spectrogram[:, : self.length // self.hop_length]
      spectrogram = spectrogram.astype(self.dtype)
  
      # expand dimensions
      one_hot = numpy.identity(self.quantize, dtype=self.dtype)[
          quantized
      ].T
  
      return one_hot[:, :-1], spectrogram, quantized[1:]
  
file_path: chainer/examples/wavenet/utils.py
imports: import random
  import librosa
  import numpy
  import chainer
label_desc: Use image node_id 2 for calling the Preprocess obj's underlying member method code with example usage: obj.__call__(path) and returns: one_hot,  spectrogram,  quantized