def tc_to_frame(tc, edit_rate):
    """ Convert timecode to sample count.

        Args:
            tc (str): Timecode string (format HH:MM:SS:FF).
            edit_rate (int): number of samples per second.

        Returns:
            Total samples count.

        >>> tc_to_frame('00:00:02:00', 24)
        48

    """
    hours, minutes, seconds, frames = map(int, tc.split(':'))
    framePerHour = edit_rate * 60 * 60
    framePerMinute = edit_rate * 60
    framePerSecond = edit_rate

    return hours * framePerHour + \
        minutes * framePerMinute + \
        seconds * framePerSecond + frames