code: def pydub_to_np(audio: pydub.AudioSegment) -> (np.ndarray, int):
      """
      Converts pydub audio segment into np.int16 of shape [duration_in_seconds*sample_rate, channels],
      """
      return np.array(
          audio.get_array_of_samples(), dtype=np.int16
      ).reshape((-1, audio.channels))
  
file_path: h2ogpt/src/tts_utils.py
imports: import io
  import librosa
  import numpy
  import pydub
  from src.utils import have_pyrubberband
label_desc: Use image node_id 6 for calling a global function with example usage: pydub_to_np(audio) and returns: np