def apply_unsynchronization(data):
    """Apply ID3v2 unsynchronization scheme to data."""
    sync_index = data.find(b'\xff')
    if sync_index == -1:
        return data
    data = bytearray(data)
    d = bytearray()
    while sync_index != -1:
        d += data[:sync_index + 1]
        b = data[sync_index + 1:sync_index + 2]
        if b >= b'\xe0':
            d += b'\x00'
            d += b
        elif b == b'\x00':
            d += b'\x00\x00'
        else:
            d += b
        data = data[sync_index + 2:]
        sync_index = data.find(b'\xff')
    d += data
    return bytes(d)
