class_docstr: Pitch shift the sound up or down without changing the tempo
code: def apply(self, samples: NDArray[np.float32], sample_rate: int):
      try:
          resample_type = (
              "kaiser_best"
              if librosa.__version__.startswith("0.8.")
              else "soxr_hq"
          )
          pitch_shifted_samples = librosa.effects.pitch_shift(
              samples,
              sr=sample_rate,
              n_steps=self.parameters["num_semitones"],
              res_type=resample_type,
          )
      except librosa.util.exceptions.ParameterError:
          warnings.warn(
              "Warning: You are probably using an old version of librosa. Upgrade"
              " librosa to 0.9.0 or later for better performance when applying"
              " PitchShift to stereo audio."
          )
          # In librosa<0.9.0 pitch_shift doesn't natively support multichannel audio.
          # Here we use a workaround that simply loops over the channels instead.
          # TODO: Remove this workaround when we remove support for librosa<0.9.0
          pitch_shifted_samples = np.copy(samples)
          for i in range(samples.shape[0]):
              pitch_shifted_samples[i] = librosa.effects.pitch_shift(
                  pitch_shifted_samples[i],
                  sr=sample_rate,
                  n_steps=self.parameters["num_semitones"],
              )
  
      return pitch_shifted_samples
  
file_path: audiomentations/audiomentations/augmentations/pitch_shift.py
imports: import random
  import warnings
  import librosa
  import numpy
  from numpy.typing import NDArray
  from audiomentations.core.transforms_interface import BaseWaveformTransform
label_desc: Use image node_id 3 for calling the PitchShift obj's underlying member method code with example usage: obj.apply(samples, sample_rate) and returns: pitch_shifted_samples