 seg_distance(seg1, seg2, 'timbre', true);
        var pitch = seg_distance(seg1, seg2, 'pitches');
        var sloudStart = Math.abs(seg1.loudness_start - seg2.loudness_start);
        var sloudMax = Math.abs(seg1.loudness_max - seg2.loudness_max);
        var duration = Math.abs(seg1.duration - seg2.duration);
        var confidence = Math.abs(seg1.confidence - seg2.confidence);
        var distance = timbre * timbreWeight + pitch * pitchWeight +
            sloudStart * loudStartWeight + sloudMax * loudM