# Support timeOffset for audio too

**URL:** <http://support.symfonium.app/t/support-timeoffset-for-audio-too/1184>\
**Category:** OpenSubsonic API extensions\
**Created:** [January 4, 2023, 9:22am UTC](http://support.symfonium.app/t/support-timeoffset-for-audio-too/1184 "2023-01-04T09:22:56Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tolriq](http://support.symfonium.app/user_avatar/support.symfonium.app/tolriq/32/726_2.png) [@Tolriq](http://support.symfonium.app/u/Tolriq)\
**Post date:** [January 4, 2023, 9:22am UTC](http://support.symfonium.app/t/support-timeoffset-for-audio-too/1184/1 "2023-01-04T09:22:57Z")

</div>

# Type of change

- API tweak

# Proposal description

Opus is a way better codec than MP3 for streaming and transcoding. Unfortunately ffmpeg and Subsonic solution with `estimateContentLength` does not work very well for seeking and might generate issues.

Supporting `timeOffset` for audio files too would allow proper seeking via stream restart at the proper position and solve this issue.

# Backward compatibility impact

N/A

# API details

No change just support timeOffset for audio files.

# Security impacts

N/A

# Potential issues

# Alternative solutions

* * *

# Proposal status

Proposed

# Server implementation status

---

<div class="post-metadata">

**Author:** ![Tolriq](http://support.symfonium.app/user_avatar/support.symfonium.app/tolriq/32/726_2.png) [@Tolriq](http://support.symfonium.app/u/Tolriq)\
**Post date:** [January 13, 2023, 4:11pm UTC](http://support.symfonium.app/t/support-timeoffset-for-audio-too/1184/2 "2023-01-13T16:11:48Z")

</div>

BTW since the API did say it’s not supported I actually never tested on any server.

@deluan Does Navidrome support that already? ([Transcoding breaks progress bar (Navidrome)](https://support.symfonium.app/t/transcoding-breaks-progress-bar-navidrome/1244))

---

<div class="post-metadata">

**Author:** ![deluan](http://support.symfonium.app/user_avatar/support.symfonium.app/deluan/32/928_2.png) [@deluan](http://support.symfonium.app/u/deluan)\
**Post date:** [January 13, 2023, 4:29pm UTC](http://support.symfonium.app/t/support-timeoffset-for-audio-too/1184/3 "2023-01-13T16:29:19Z")

</div>

Navidrome supports the `estimateContentLength`, but as you already know this is not precise due to variable bitrate encoding. And ND currently doesn’t support the `timeOffset`.

What I do for the web player is set the duration of the song in the player, and support the HTTP `range` header. I also set the `x-content-duration` header in the response with the duration in seconds.

---

<div class="post-metadata">

**Author:** ![Tolriq](http://support.symfonium.app/user_avatar/support.symfonium.app/tolriq/32/726_2.png) [@Tolriq](http://support.symfonium.app/u/Tolriq)\
**Post date:** [January 13, 2023, 4:53pm UTC](http://support.symfonium.app/t/support-timeoffset-for-audio-too/1184/4 "2023-01-13T16:53:51Z")

</div>

Unfortunately ExoPlayer have some issues with wrong values returned by estimateContentLength causing issues are the end of the songs so is not reliable enough to be used.

timeOffset would solve this as it’s supported by all other APIs but I guess I’ll have to wait and see how the extension goes ☹

---

<div class="post-metadata">

**Author:** ![itm](http://support.symfonium.app/letter_avatar_proxy/v4/letter/i/da6949/32.png) [@itm](http://support.symfonium.app/u/itm)\
**Post date:** [January 13, 2023, 5:52pm UTC](http://support.symfonium.app/t/support-timeoffset-for-audio-too/1184/5 "2023-01-13T17:52:08Z")

</div>

The web player of LMS already uses a time offset to seek when transcoding is active, so it would be quite trivial to add. When no transcode is active, there is some more work to have enough precision but I think it would still be feasible.
