Announcements

Help Wizard

Step 1

NEXT STEP

Weird behavior of Timestamp

Weird behavior of Timestamp

Im currently working on an app using the spotify web API. To precisely calculate the current song progress i was planning on calculating it by getting the timestamp and progress_ms from the current playback state endpoint. The issue is that the timestamp does not seem to change with request and only show the time the song was started (or when playback was interrupted the time of restart) which makes it useless to calculate the progress precisely. This also does not line up with the description which states that the timestamp is from when the data was fetched.

Plan

Premium

Country

 

Device

Windows Laptop, Esp32

Operating System

Windows (Python) Esp32( C++)

 

Reply
4 Replies

Hi Chaerne,

I believe our problem lies in the documentation. Rather than saying "Timestamp when data was fetched", it should probably say something similar to "Timestamp when playback state was changed (play, pause, skip, new song, etc.)". I hope that clears up the confusion.

Hi LambertSpot, is this a time of when the playback changed in the actual user's player on their machine or a time of when this change was registered on your server (with internet delay)?

Yes that seems more like that what the function is doing.
But in that case i would maybe suggest you add another info where the time of the fetch was, as that would allow for example to make a progress bar which is still exact, even if the wifi is slow, or what i was trying to do was flashing some leds on the beat which can be received with the tracks audio analysis endpoint. To link that up in realtime, such when data was fetched info would be great as calculating the request time by assuming it is symetric works, but often not that good.

If that data is not included due to the fact that you are not allowed to sync video etc to spotifies music i can understand but otherwise i would be happy about such data
Thank you in Advance and for the clarification

 

 

Suggested posts

Let's introduce ourselves!

Hey there you, ย  Yeah, you!ย 😁 ย  Welcome - we're glad you joined the Spotify Community! ย  While you here, let's have a fun game and getโ€ฆ

ModeratorStaff / Moderator/ 4 years ago  in Social & Random