Share via

MediaSourceAudioInputNode.Position property doesn't work properly

vansa 41 Reputation points
2022-03-17T13:38:19.717+00:00

I'm using MediaSourceAudioInputNode.Position for Audio Graph to get the position of the playback. It always gives 0 value.

For comparison, using Media Playback class such as MediaPlaybackSession.Position Property works fine. It gives me the position of the playback.

Developer technologies | Universal Windows Platform (UWP)
Windows development | Windows API - Win32

Answer accepted by question author

  1. Anonymous
    2022-04-05T04:25:04.44+00:00

    Hello,

    Welcome to Microsoft Q&A!

    It always gives 0 value. Is there a way to get the position/time of the playback for live content?

    @vansa I've gotten the response from the team and we could confirm this behavior is by design. Live streams don't have an end, so its file duration is set to -1. This value is generally used to calculate the current position in conjunction with a calculation based on the sampling rate of the audio format. The result of this calculation is always going to be 0 because of the duration value.

    Currently, there is no workaround when the live stream doesn't have a specified end time or duration.

    Thank you.


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    Was this answer helpful?

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.