def process_one(path, sr):
    """
    Args:
        path: audio file path
        sr: sampling rate
    """
    try:
        # YAAPT throws errors in some rare cases
        f0 = get_f0_by_filename(path, sr)
    except Exception as e:
        print(
            f"WARNING: error when processing {path}. set f0 to zero. original error message:\n{e}"
        )
        f0 = None
    return f0
Args:
path: audio file path
sr: sampling rate
examples/textless_nlp/pgslm/preprocess_f0.py