code: def gen_audio(is_clean, params, index, audio_samples_length=-1):
      """Calls build_audio() to get an audio signal, and verify that it meets the
      activity threshold"""
  
      clipped_files = []
      low_activity_files = []
      if audio_samples_length == -1:
          audio_samples_length = int(
              params["audio_length"] * params["fs"]
          )
      if is_clean:
          activity_threshold = params["clean_activity_threshold"]
      else:
          activity_threshold = params["noise_activity_threshold"]
  
      while True:
          audio, source_files, new_clipped_files, index = build_audio(
              is_clean, params, index, audio_samples_length
          )
  
          clipped_files += new_clipped_files
          if len(audio) < audio_samples_length:
              continue
  
          if activity_threshold == 0.0:
              break
  
          percactive = activitydetector(audio=audio)
          if percactive > activity_threshold:
              break
          else:
              low_activity_files += source_files
  
      return (
          audio,
          source_files,
          clipped_files,
          low_activity_files,
          index,
      )
  
file_path: espnet/egs2/dns_icassp22/enh1/local/noisyspeech_synthesizer.py
imports: import argparse
  import configparser
  import glob
  import multiprocessing
  import os
  import sys
  from pathlib import Path
  from random import shuffle
  import librosa
  import numpy
  import pandas
  from audiolib import activitydetector, audioread, audiowrite, is_clipped, segmental_snr_mixer
  from scipy import signal
  import utils
label_desc: Use image node_id 3 for calling a global function with example usage: gen_audio(is_clean, params, index, audio_samples_length) and returns: audio,  source_files,  clipped_files,  low_activity_files,  index