def find_max_interval_praat(sound, interval_list):
    """
    Given a sound recording and a list of intervals specified by boundaries in seconds, returns index of the
    interval with the highest sound intensity, intensity of this interval, index of the longest interval and
    the length of the longest interval.

    Intensity is computed as closely as possible to the intensity computed by Praat software.
    """

    max_intensity = None
    max_intensity_index = None

    max_length = None
    max_length_index = None

    # Finding interval with highest intensity and the longest interval.

    for index, (begin_sec, end_sec, _) in enumerate(interval_list):

        intensity = sound.get_interval_intensity(begin_sec, end_sec)
        length = end_sec - begin_sec

        if max_intensity == None or intensity > max_intensity:
            max_intensity = intensity
            max_intensity_index = index

        if max_length == None or length > max_length:
            max_length = length
            max_length_index = index

    return (max_intensity_index, max_intensity, max_length_index, max_length)