docstr: Test loading an audio signal from a list of single-channel files.
          
docstr_tok: ["Test","loading","an","audio","signal","from","a","list","of","single-channel","files","."]
code: def test_audio_segment_multichannel_with_list(
      self, tmpdir, num_channels, channel_selectors, offset, duration
  ):
      """Test loading an audio signal from a list of single-channel files."""
      sample_rate = 16000
      signal_len_sec = 5
      num_samples = signal_len_sec * sample_rate
      rtol, atol = 1e-5, 1e-6
  
      # Random samples
      samples = np.random.rand(num_samples, num_channels)
  
      # Save audio
      audio_files = []
      for m in range(num_channels):
          a_file = os.path.join(tmpdir, f"ch_{m}.wav")
          sf.write(a_file, samples[:, m], sample_rate)
          audio_files.append(a_file)
      mc_file = os.path.join(tmpdir, f"mc.wav")
      sf.write(mc_file, samples, sample_rate)
  
      for channel_selector in channel_selectors:
          # UUT: loading audio from a list of files
          uut_segment = AudioSegment.from_file(
              audio_file=audio_files,
              offset=offset,
              duration=duration,
              channel_selector=channel_selector,
          )
  
          # Reference: load from the original file
          ref_segment = AudioSegment.from_file(
              audio_file=mc_file,
              offset=offset,
              duration=duration,
              channel_selector=channel_selector,
          )
  
          # Check
          assert (
              uut_segment.sample_rate == ref_segment.sample_rate
          ), f"channel_selector {channel_selector}: expecting {ref_segment.sample_rate}, but UUT segment has {uut_segment.sample_rate}"
          assert (
              uut_segment.num_samples == ref_segment.num_samples
          ), f"channel_selector {channel_selector}: expecting {ref_segment.num_samples}, but UUT segment has {uut_segment.num_samples}"
          assert np.allclose(
              uut_segment.samples,
              ref_segment.samples,
              rtol=rtol,
              atol=atol,
          ), f"channel_selector {channel_selector}: samples not matching"
  
      # Try to get a channel that is out of range.
      with pytest.raises(
          RuntimeError, match="Channel cannot be selected"
      ):
          AudioSegment.from_file(
              audio_file=audio_files, channel_selector=num_channels
          )
  
      if num_channels > 1:
          # Try to load a list of multichannel files
          # This is expected to fail since we only support loading a single-channel signal
          # from each file when audio_file is a list
          with pytest.raises(
              RuntimeError,
              match="Expecting a single-channel audio signal",
          ):
              AudioSegment.from_file(audio_file=[mc_file, mc_file])
  
          with pytest.raises(
              RuntimeError,
              match="Expecting a single-channel audio signal",
          ):
              AudioSegment.from_file(
                  audio_file=[mc_file, mc_file], channel_selector=0
              )
  
imports: import os
  from collections import namedtuple
  from typing import List, Type, Union
  import librosa
  import matplotlib.pyplot
  import numpy
  import pytest
  import scipy
  import soundfile
  import torch
  from nemo.collections.asr.parts.preprocessing.segment import AudioSegment
  from nemo.collections.asr.parts.utils.audio_utils import SOUND_VELOCITY
  from nemo.collections.asr.parts.utils.audio_utils import calculate_sdr_numpy, convmtx_mc_numpy, db2mag, estimated_coherence, generate_approximate_noise_field, get_segment_start, mag2db, pow2db, rms, select_channels, theoretical_coherence, toeplitz
label_desc: Use image node_id 2 for calling the TestAudioSegment obj's underlying member method code with example usage: obj.test_audio_segment_multichannel_with_list(tmpdir, num_channels, channel_selectors, offset, duration) without return types