The following forum(s) are migrating to a new home on Microsoft Q&A (Preview): Developing Universal Windows apps!

Ask new questions on Microsoft Q&A (Preview).
Interact with existing posts until December 13, 2019, after which content will be closed to all new and existing posts.

Learn More

 none
[uwp] [C#] MediaElement Error The requested audio playback device is currently in use 0xc00d4e85 RRS feed

  • Question

  • I use MediaPlayer for playing music in background.

    But in the same application I use MediaPlayerElement for playing video

    If I create MediaPlayerElement in such way :

    <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}" DoubleTapped="UIElement_OnDoubleTapped" >
            <MediaPlayerElement x:Name="MediaElement" AreTransportControlsEnabled="True"></MediaPlayerElement>
        </Grid>

    this.MediaElement.SetMediaPlayer(new MediaPlayer);

    I get error everytime if music are playing

    MediaElement Error The requested audio playback device is currently in use 0xc00d4e85

    If I use the same MediaPlayer for music

    this.MediaElement.SetMediaPlayer(PlaybackService.Instance.Player);

    I get the same error, but in very hard reproduced situation.

    How to fix it ?


    Mood Store

    Tuesday, January 31, 2017 9:23 AM

All replies

  • Hello SmartWhy,

    I had similar situation, just without playing video (background music, effects and voice). I solved the problem by providing media player for each task, so I ended up with a service holding 3 media elements. However, this was working on a PC, but upon switching to mobile, Voice mediaElement was shutting down background music completely. This is apparently windows phone behavior, allowing only one mediaElement to play at a time.

    I ended up with SharpDX library. Again I used 3 instances for each task (bcg music, fx and voice) but it worked for both PC and Mobile. I'm not sure about video support, but probably you can use SharpDX for background music, and media elemet for playing video...

    Hope it helps

    Greetings,

    Mr. Coy

    Tuesday, January 31, 2017 3:11 PM