code: def auresize(audio_arr, size, channel_first=False):
      """
      Resize audio_arr by pydub module.
      Args:
          audio_arr (numpy.ndarray): Audio array to save.
              Audio shape is considered as (samples, channels) by default.
          size (tupple of int): Output shape. The order is (samples, channels).
          channel_first (bool):
              This argument specifies the shape of audio is whether (samples, channels) or (channels,
              samples).
              Default value is False, which means the audio_arr shape is (samples, channels)
      Returns:
           numpy.ndarray whose shape is (samples, channels) or (channels, samples)
      """
  
      audio = _auresize_before(audio_arr, size, channel_first)
      n_channel_num = size[1]
      n_sample_num = size[0]
      o_channel_num = audio.shape[1]
      o_sample_num = audio.shape[0]
  
      if o_channel_num != 1 and n_channel_num != 1:
          if o_channel_num != n_channel_num:
              raise ValueError(
                  "pydub set_channels only supports mono-to-multi channel"
                  " and multi-to-mono channel conversion"
              )
  
      audio_segment = get_audiosegment_from_nparray(audio)
      new_rate = math.floor(48000 * n_sample_num / o_sample_num + 1)
      audio_segment = audio_segment.set_frame_rate(new_rate)
      audio_segment = audio_segment.set_channels(n_channel_num)
      audio_segment = audio_segment.get_sample_slice(0, n_sample_num)
  
      resized = get_nparray_from_pydub(audio_segment)
  
      return resized
  
file_path: nnabla/python/src/nnabla/utils/audio_utils/pydub_utils.py
imports: from __future__ import absolute_import, division
  import math
  import os
  import warnings
  import numpy
  from pydub import AudioSegment
  from .common import _auread_before, _auread_after, _ausave_before, _auresize_before
label_desc: Use image node_id 5 for calling a global function with example usage: auresize(audio_arr, size, channel_first) and returns: resized