def METHOD_NAME(args):
    # making sure we are requested either denoise or vad
    if not args.denoise and not args.vad:
        log.error("No denoise or vad is requested.")
        return
    log.info("Creating out directories...")
    if args.denoise:
        out_denoise = Path(args.output_dir).absolute().joinpath(PATHS[0])
        out_denoise.mkdir(parents=True, exist_ok=True)
    if args.vad:
        out_vad = Path(args.output_dir).absolute().joinpath(PATHS[1])
        out_vad.mkdir(parents=True, exist_ok=True)
    log.info("Loading pre-trained speech enhancement model...")
    model = master64().to(args.device)
    log.info("Building the VAD model...")
    vad = webrtcvad.Vad(int(args.vad_agg_level))
    # preparing the output dict
    output_dict = defaultdict(list)
    log.info(f"Parsing input manifest: {args.audio_manifest}")
    with open(args.audio_manifest, "r") as f:
        manifest_dict = csv.DictReader(f, delimiter="\t")
        for row in tqdm(manifest_dict):
            filename = str(row["audio"])
            final_output = filename
            keep_sample = True
            n_frames = row["n_frames"]
            snr = -1
            if args.denoise:
                output_path_denoise = out_denoise.joinpath(Path(filename).name)
                # convert to 16khz in case we use a differet sr
                tmp_path = convert_sr(final_output, 16000)
                # loading audio file and generating the enhanced version
                out, sr = torchaudio.load(tmp_path)
                out = out.to(args.device)
                estimate = model(out)
                estimate = (1 - args.dry_wet) * estimate + args.dry_wet * out
                write(estimate[0], str(output_path_denoise), sr)
                snr = utils.cal_snr(out, estimate)
                snr = snr.cpu().detach().numpy()[0][0]
                final_output = str(output_path_denoise)
            if args.vad:
                output_path_vad = out_vad.joinpath(Path(filename).name)
                sr = torchaudio.info(final_output).sample_rate
                if sr in [16000, 32000, 48000]:
                    tmp_path = final_output
                elif sr < 16000:
                    tmp_path = convert_sr(final_output, 16000)
                elif sr < 32000:
                    tmp_path = convert_sr(final_output, 32000)
                else:
                    tmp_path = convert_sr(final_output, 48000)
                # apply VAD
                segment, sample_rate = apply_vad(vad, tmp_path)
                if len(segment) < sample_rate * MIN_T:
                    keep_sample = False
                    print((
                        f"WARNING: skip {filename} because it is too short "
                        f"after VAD ({len(segment) / sample_rate} < {MIN_T})"
                    ))
                else:
                    if sample_rate != sr:
                        tmp_path = generate_tmp_filename("wav")
                        write_wave(tmp_path, segment, sample_rate)
                        convert_sr(tmp_path, sr,
                                   output_path=str(output_path_vad))
                    else:
                        write_wave(str(output_path_vad), segment, sample_rate)
                    final_output = str(output_path_vad)
                    segment, _ = torchaudio.load(final_output)
                    n_frames = segment.size(1)
            if keep_sample:
                output_dict["id"].append(row["id"])
                output_dict["audio"].append(final_output)
                output_dict["n_frames"].append(n_frames)
                output_dict["tgt_text"].append(row["tgt_text"])
                output_dict["speaker"].append(row["speaker"])
                output_dict["src_text"].append(row["src_text"])
                output_dict["snr"].append(snr)
        out_tsv_path = Path(args.output_dir) / Path(args.audio_manifest).name
        log.info(f"Saving manifest to {out_tsv_path.as_posix()}")
        save_df_to_tsv(pd.DataFrame.from_dict(output_dict), out_tsv_path)