# Summary listen time for audio file

**URL:** <https://discuss.elastic.co/t/summary-listen-time-for-audio-file/343113>\
**Category:** Elastic Search\
**Tags:** elastic-app-search\
**Created:** [September 15, 2023, 7:25am UTC](https://discuss.elastic.co/t/summary-listen-time-for-audio-file/343113 "2023-09-15T07:25:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![abram](https://avatars.discourse-cdn.com/v4/letter/a/a6a055/32.png) [@abram](https://discuss.elastic.co/u/abram)\
**Post date:** [September 15, 2023, 7:25am UTC](https://discuss.elastic.co/t/summary-listen-time-for-audio-file/343113/1 "2023-09-15T07:25:59Z")

</div>

I log listen time from my player, (second\_frame is integer\_range). How i can sumamry listen time, so in this case ranges are (2945 - 2970, 2957 - 2962, 2962 - 2977), it should response 32 second (first region + 25, second +0 because is withing first, and third + 7 because it's intersect with first). Ps. ranges can intersect, be within , double log, so i want to summary only distinct listen time.

```auto
[{
    "previous_second": 2955,
    "second": 2970,
    "duration": 5177,
    "second_frame": {
      "lt": 2970,
      "gte": 2945
    }
}, {
    "previous_second": 2957,
    "second": 2962,
    "duration": 5177,
    "second_frame": {
      "lt": 2962,
      "gte": 2957
    }
}, {
    "previous_second": 2962,
    "second": 2977,
    "duration": 5177,
    "second_frame": {
      "lt": 2977,
      "gte": 2962
    }
}]

```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [October 13, 2023, 7:26am UTC](https://discuss.elastic.co/t/summary-listen-time-for-audio-file/343113/2 "2023-10-13T07:26:13Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
