code: def prepare_multich_datadir(datadir_1ch, outdir):
      def parse_noisy_audio_uid(uid):
          # Noisy audio file name format:
          # Lab41-SRI-VOiCES-< room >-< distractor_noise >-
          #   sp< speaker_ID >-ch< chapter_ID >-seg< segment_ID >-
          #   mc< mic_ID >-< mic_type >-< mic_location >-dg< degree >.wav
          tup = uid.split("-")
          assert len(tup) == 12, tup
          sid = tup[5]
          assert sid.startswith("sp"), sid
          sid = sid[2:]
          tup[8] = r"mc.*"
          tup[10] = r".*"
          pattern = "-".join(tup)
          return sid, pattern
  
      # wav.scp and utt2spk
      utt2wavs = defaultdict(list)
      utt2spk = {}
      with (datadir_1ch / "wav.scp").open("r") as f:
          for line in f:
              uid, wavpath = line.strip().split(maxsplit=1)
              sid, pattern = parse_noisy_audio_uid(uid)
              # key = sid + "_" + pattern
              key = pattern
              utt2wavs[key].append(wavpath)
              utt2spk[key] = sid
  
      keys = sorted(utt2wavs.keys())
      with (outdir / "wav.scp").open("w") as f:
          for uid in keys:
              wavpaths = utt2wavs[uid]
              info = "sox -M " + " ".join(sorted(wavpaths))
              info += f" -c {len(wavpaths)} -t wav - |"
              f.write(f"{uid} {info}\n")
      with (outdir / "utt2spk").open("w") as f:
          for uid in keys:
              spk = utt2spk[uid]
              f.write(f"{uid} {spk}\n")
  
      # text
      utt2text = {}
      with (datadir_1ch / "text").open("r") as f:
          for line in f:
              uid, text = line.strip().split(maxsplit=1)
              sid, pattern = parse_noisy_audio_uid(uid)
              # key = sid + "_" + pattern
              key = pattern
              if key not in utt2text:
                  utt2text[key] = text
              else:
                  assert utt2text[key] == text, (
                      line,
                      utt2text[key],
                      text,
                  )
  
      with (outdir / "text").open("w") as f:
          for uid in keys:
              text = utt2text[uid]
              f.write(f"{uid} {text}\n")
  
label_desc: Use image node_id 1 for calling a global function with example usage: prepare_multich_datadir(datadir_1ch, outdir) and returns: sid,  pattern