Background Audio Agent and Media Player in Windows phone 8 - windows-phone-8

I stuck in a big problem I am playing audio in background using BackgroundAudioPlayer working fine while I am playing another audio file using MediaElement on foreground the background sound is stopped.I want to play both sound simultaneously background and foreground please let me how it will be done.

MediaElement and BackgroundAudioPlayer are exclusive - you can only use one of these at a time.
You are able to play additional sounds using the XNA SoundEffect APIs however. For example of these APIs see this blog entry.

Related

How to access audio stream of BackgroundMediaPlayer Windows Phone?

Is it possible to add custom sound effects to the music being played by BackgroundMediaPlayer? I need raw samples, like in PCM, to apply some simple math.

Play audio through earpiece in Windows phone 8

I have an mp3 file and I want to play it through the earpiece rather than the phone's speakers. Since I want the playing to happen, even when in background, I have implemented a Windows Phone Audio Play back agent. Now how can I play the audio in earpiece only?
If you use the MediaElement provided to you in the Windows Phone Toolbox you wouldn't have to implement a play back agent or decide what speaker to play it through. If you plug in your earphones the phone will direct audio coming from the MediaElement to the audio jack. This is the native behavior of MediaElement and all mobile sound components.

How can I use 2 MediaElements at the same time?

I'm creating a mini game. It has music background and gun sound. But I can not play them at the same time.
How can I do it ???
You can't - as MSDN says:
When a MediaElement control plays audio or video content, any background sounds or media already playing are halted. The app launches the playback experience when the user taps the control. Only one MediaElement control can operate at a time.
Instead you can try to use SoundEffect from XNA to play your gun sound.

Make sound or play audio in the background agent in Windows Phone

Is it possible to play a piece of audio (very short) in the background agent in Windows Phone? Not background music. What I want to achieve is to tell user what the time is every half an hour.
Try this, it's a tutorial with a sample project:
http://msdn.microsoft.com/en-us/library/windowsphone/develop/hh202978%28v=vs.105%29.aspx

Windows phone Audio play back Agent

Can anybody please tell me that how to play dynamic music list using background playback agent in windows phone 8,i search every where on internet but tutorials can use tha hard coded music list
You can write the information about the music list from the UI (main app) to a file in Isolated storage and then read that information into a List of AudioTrack from the Background Audio Playback Agent.