def closest_annotation(timestamp, track):
    """
    Find the closest annotation in a track to a given timestamp.
    """
    closest = 0
    closest_delta = float('inf')

    for i in range(len(track)):
        delta = abs(track[i].timestamp - timestamp)
        if delta < closest_delta:
            closest_delta = delta
            closest = i
    return track[closest]