code: def sample_audio(
      manifest_entry: Dict[str, Any],
      audio_dir: Path,
      sample_rate: int,
      n_samples: int,
      volume_norm: bool = False,
  ) -> Tuple[np.ndarray, Path, Path]:
      """
      Randomly sample an audio segment from a manifest entry.
  
      Args:
          manifest_entry: Manifest entry dictionary.
          audio_dir: base directory where audio is stored.
          sample_rate: Sample rate to load audio as.
          n_samples: Size of audio segment to sample.
          volume_norm: Whether to apply volume normalization to the sampled audio.
  
      Returns:
          Audio array, and absolute and relative paths to audio file.
      """
      audio_filepath_abs, audio_filepath_rel = get_audio_filepaths(
          manifest_entry=manifest_entry, audio_dir=audio_dir
      )
      offset = manifest_entry.get("offset", None)
      duration = manifest_entry.get("duration", 0.0)
  
      if offset is not None:
          audio_dur = librosa.get_duration(filename=audio_filepath_abs)
          max_end_sec = min(offset + duration, audio_dur - 0.1)
          max_offset = max(
              offset, max_end_sec - (n_samples / sample_rate)
          )
      else:
          max_offset = None
  
      audio_segment = _segment_audio(
          audio_filepath=audio_filepath_abs,
          sample_rate=sample_rate,
          offset=offset,
          max_offset=max_offset,
          n_samples=n_samples,
      )
      audio = audio_segment.samples
  
      if volume_norm:
          audio = normalize_volume(audio)
  
      return audio, audio_filepath_abs, audio_filepath_rel
  
imports: import functools
  import os
  import random
  import traceback
  from pathlib import Path
  from typing import Any, Dict, List, Optional, Tuple
  import librosa
  import numpy
  import torch
  from einops import rearrange
  from scipy import ndimage
  from torch.special import gammaln
  from nemo.collections.asr.parts.preprocessing.segment import AudioSegment
label_desc: Use image node_id 16 for calling a global function with example usage: sample_audio(manifest_entry, audio_dir, sample_rate, n_samples, volume_norm) and returns: audio,  audio_filepath_abs,  audio_filepath_rel