none
UWP: MediaPlayer/MediaStreamSource outputting 48kHz PCM stutters and consumes gigabytes of memory RRS feed

  • General discussion

  • SAMPLE APP: try it yourself

    https://www.foobar2000.org/temp/MediaStreamSourceBroken-v1.0.zip

    USAGE
    Compile and run.
    A combo box lets you choose playback sample rate. Hitting "play" will play a test tone at the selected sample rate.
    If you play the test tone at the native sample rate of your audio device - typically 48000Hz, you will hear stuttering, and the application will eat massive amounts of memory due to MediaStreamSource buffering audio data far ahead of actual playback position.
    Some additional parameters (sample format, channel count) can be configured in MainPage.xaml.cpp. However they were found to have no significant impact on the issue; sample rate is the primary factor.

    Bug originally found and verified on:
    Microsoft Windows [Version 10.0.10240]

    The problem has been also reported via Windows Feedback app. I am sharing my findings here in hope that someone else finds this useful. You can work around this bug by playing your audio by means other than MediaStreamSource, such as XAudio2 - but this means problems with playing while your app is in background.

    Monday, October 12, 2015 11:35 AM

All replies