Question

From what I read, WP8 does support amr

However, I don't know how to play it.

  1. When using SoundEffect, I can't hear anything, maybe it's because SoundEffect supports wav only. Someone already asked here.
  2. I don't want to use BackgroundAudioPlayer or MediaPlayerLauncher, as they are overkill

Is there any workaround to play amr with SoundEffect, or is there a better API to play it ?

P/S: this amr file is record using WP8 API

Was it helpful?

Solution

You can play them using a MediaElement. Just add a MediaElement to your xaml file. Then set the source to your opened file. Something like:

using(IsolatedStorageFileStream stream = appStorage.OpenFile(mFilename, FileMode.Open))
{
     mMediaPlayer.SetSource(stream);
}

Then when you want to play the audio you call:

mMediaPlayer.Play();
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top