code: def test_read_audio_multichannel(tmpdir, device):
      from speechbrain.dataio.dataio import (
          read_audio_multichannel,
          write_audio,
      )
  
      test_waveform = torch.rand(16000, 2, device=device)
      wavfile = os.path.join(tmpdir, "wave.wav")
      # sf.write(wavfile, test_waveform, 16000, subtype="float")
      write_audio(wavfile, test_waveform.cpu(), 16000)
  
      # dummy annotation we save and load one multichannel file
      for i in range(2):
          start = torch.randint(0, 8000, (1,), device=device).item()
          stop = (
              start
              + torch.randint(500, 1000, (1,), device=device).item()
          )
  
          wav_obj = {
              "wav": {"files": [wavfile], "start": start, "stop": stop}
          }
  
          loaded = read_audio_multichannel(wav_obj["wav"]).to(device)
          assert loaded.allclose(
              test_waveform[start:stop, :], atol=1e-4
          )
          # set to equal when switching to the sox_io backend
          # assert torch.all(torch.eq(loaded, test_waveform[:,start:stop]))
  
      # we test now multiple files loading
      test_waveform_2 = torch.rand(16000, 2, device=device)
      wavfile_2 = os.path.join(tmpdir, "wave_2.wav")
      write_audio(wavfile_2, test_waveform_2.cpu(), 16000)
      # sf.write(wavfile_2, test_waveform_2, 16000, subtype="float")
  
      for i in range(2):
          start = torch.randint(0, 8000, (1,), device=device).item()
          stop = (
              start
              + torch.randint(500, 1000, (1,), device=device).item()
          )
  
          wav_obj = {
              "wav": {
                  "files": [wavfile, wavfile_2],
                  "start": start,
                  "stop": stop,
              }
          }
  
          loaded = read_audio_multichannel(wav_obj["wav"]).to(device)
          test_waveform3 = torch.cat(
              (
                  test_waveform[start:stop, :],
                  test_waveform_2[start:stop, :],
              ),
              1,
          )
          assert loaded.allclose(test_waveform3, atol=1e-4)
  
imports: import torch
  import os
label_desc: Use image node_id 3 for calling a global function with example usage: test_read_audio_multichannel(tmpdir, device) without return types