Bookmark (persist) time position of played files

i would like to implement a feature that can save the current time position of a played file on cancel or stop.
i’ve checked the available events, but it seems to me that the track_playback_ended didn’t fire on cancel or stop, it is fired at the end of the file.
the playback_state_changed event is available, but it doesn’t contain the time position.

any advice is welcomed.

There’s for pausing but when you issue a stop command you do actually stop, which involves resetting the playback position to 0 (and releasing the audio device etc).

Alternatively you can query for the current position after you receive a playback_state_changed event. But you’ll hit the same problem that if it was a stop then the returned position will be 0.

I don’t think we have anything in our API that will tell you the time before stopping.

thank you for the answer, i think the track_playback_paused is a great idea, and it might work for me. thank you again!