def cross(cp, size):
    _check_params(len(cp), size)

    crossings = 0
    last_sample = 0
    for sample in _get_samples(cp, size):
        if sample <= 0 < last_sample or sample >= 0 > last_sample:
            crossings += 1
        last_sample = sample

    return crossings
dataset/ETHPy150Open jiaaro/pydub/pydub/pyaudioop.py/cross/original