class_docstr: SeparateSpeech class
  
  Examples:
      >>> import soundfile
      >>> separate_speech = SeparateSpeech("enh_config.yml", "enh.pth")
      >>> audio, rate = soundfile.read("speech.wav")
      >>> separate_speech(audio)
      [separated_audio1, separated_audio2, ...]
code: def __init__(
      self,
      train_config: Union[Path, str] = None,
      model_file: Union[Path, str] = None,
      inference_config: Union[Path, str] = None,
      segment_size: Optional[float] = None,
      hop_size: Optional[float] = None,
      normalize_segment_scale: bool = False,
      show_progressbar: bool = False,
      ref_channel: Optional[int] = None,
      normalize_output_wav: bool = False,
      device: str = "cpu",
      dtype: str = "float32",
      enh_s2t_task: bool = False,
  ):
      assert check_argument_types()
  
      task = EnhancementTask if not enh_s2t_task else EnhS2TTask
  
      # 1. Build Enh model
  
      if inference_config is None:
          enh_model, enh_train_args = task.build_model_from_file(
              train_config, model_file, device
          )
      else:
          # Overwrite model attributes
          train_config = get_train_config(
              train_config, model_file=model_file
          )
          with train_config.open("r", encoding="utf-8") as f:
              train_args = yaml.safe_load(f)
  
          with Path(inference_config).open("r", encoding="utf-8") as f:
              infer_args = yaml.safe_load(f)
  
          if enh_s2t_task:
              arg_list = ("enh_encoder", "enh_separator", "enh_decoder")
          else:
              arg_list = ("encoder", "separator", "decoder")
          supported_keys = list(
              chain(*[[k, k + "_conf"] for k in arg_list])
          )
          for k in infer_args.keys():
              if k not in supported_keys:
                  raise ValueError(
                      "Only the following top-level keys are supported: %s"
                      % ", ".join(supported_keys)
                  )
  
          recursive_dict_update(train_args, infer_args, verbose=True)
          enh_train_args = argparse.Namespace(**train_args)
          enh_model = build_model_from_args_and_file(
              task, enh_train_args, model_file, device
          )
  
      if enh_s2t_task:
          enh_model = enh_model.enh_model
      enh_model.to(dtype=getattr(torch, dtype)).eval()
  
      self.device = device
      self.dtype = dtype
      self.enh_train_args = enh_train_args
      self.enh_model = enh_model
  
      # only used when processing long speech, i.e.
      # segment_size is not None and hop_size is not None
      self.segment_size = segment_size
      self.hop_size = hop_size
      self.normalize_segment_scale = normalize_segment_scale
      self.normalize_output_wav = normalize_output_wav
      self.show_progressbar = show_progressbar
  
      self.num_spk = enh_model.num_spk
      task = "enhancement" if self.num_spk == 1 else "separation"
  
      # reference channel for processing multi-channel speech
      if ref_channel is not None:
          logging.info(
              "Overwrite enh_model.separator.ref_channel with {}".format(
                  ref_channel
              )
          )
          enh_model.separator.ref_channel = ref_channel
          if hasattr(enh_model.separator, "beamformer"):
              enh_model.separator.beamformer.ref_channel = ref_channel
          self.ref_channel = ref_channel
      else:
          self.ref_channel = enh_model.ref_channel
  
      self.segmenting = (
          segment_size is not None and hop_size is not None
      )
      if self.segmenting:
          logging.info("Perform segment-wise speech %s" % task)
          logging.info(
              "Segment length = {} sec, hop length = {} sec".format(
                  segment_size, hop_size
              )
          )
      else:
          logging.info("Perform direct speech %s on the input" % task)
  
imports: import argparse
  import logging
  import sys
  from itertools import chain
  from pathlib import Path
  from typing import Any, List, Optional, Sequence, Tuple, Union
  import humanfriendly
  import numpy
  import torch
  import yaml
  from tqdm import trange
  from typeguard import check_argument_types
  from espnet2.enh.diffusion_enh import ESPnetDiffusionModel
  from espnet2.enh.loss.criterions.tf_domain import FrequencyDomainMSE
  from espnet2.enh.loss.criterions.time_domain import SISNRLoss
  from espnet2.enh.loss.wrappers.pit_solver import PITSolver
  from espnet2.fileio.sound_scp import SoundScpWriter
  from espnet2.tasks.enh import EnhancementTask
  from espnet2.tasks.enh_s2t import EnhS2TTask
  from espnet2.torch_utils.device_funcs import to_device
  from espnet2.torch_utils.set_all_random_seed import set_all_random_seed
  from espnet2.train.abs_espnet_model import AbsESPnetModel
  from espnet2.utils import config_argparse
  from espnet2.utils.types import str2bool, str2triple_str, str_or_none
  from espnet.utils.cli_utils import get_commandline_args
label_desc: Use image node_id 1 to create a new SeparateSpeech object  with example: obj = SeparateSpeech(train_config, model_file, inference_config, segment_size, hop_size, normalize_segment_scale, show_progressbar, ref_channel, normalize_output_wav, device, dtype, enh_s2t_task)