You can play Mp3 sounds by using Media Element. but VS does not support more then 10 MediaElemnets.
as in my case, i made a Funny Ringtones App, in which i uploaded 30 Ringtones.I just use only one media element.
here is the code: which will surely help you...!!!
Xaml Code:
<!--LayoutRoot is the root grid where all page content is placed-->
<Grid x:Name="LayoutRoot" Margin="0,0,0,-68" Background="#FFF7C4EC">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<!--TitlePanel contains the name of the application and page title-->
<StackPanel Background="#FFAAC57B" x:Name="TitlePanel" Grid.Row="0" Margin="-19,17,0,28"/>
<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
<MediaElement x:Name="m1" AutoPlay="True" Margin="0,105,10,-36"/>
<ListBox Height="auto" Width="auto" Margin="0,110,0,0" >
<!--1-->
<Grid Tap="Grid_Tap_1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="11*"/>
<ColumnDefinition Width="3*"/>
</Grid.ColumnDefinitions>
<!--2-->
<Button BorderBrush="LightGray" Content="" BorderThickness="0" Click="Button_Click_1" HorizontalAlignment="Left" VerticalAlignment="Top" Width="114" Margin="-20,-24,0,-20" Height="124">
<Button.Background>
<ImageBrush Stretch="Fill" ImageSource="/images/a.png"/>
</Button.Background>
</Button>
<TextBlock HorizontalAlignment="Left" TextWrapping="Wrap" Text="Answer_The_Phone" VerticalAlignment="Bottom" Margin="94,0,0,4" RenderTransformOrigin="2.13,1.496" Height="43" Width="270" Foreground="#FF0F0F0F" FontSize="30" FontFamily="Segoe WP Semibold" Grid.ColumnSpan="2"/>
</Grid>
<!--2-->
<Grid Tap="Grid_Tap_2">
<Button BorderBrush="LightGray" BorderThickness="0" Content="" Click="Button_Click_2" HorizontalAlignment="Left" VerticalAlignment="Top" Width="114" Margin="-20,-24,0,-20" Height="124">
<Button.Background>
<ImageBrush Stretch="Fill" ImageSource="/images/b.png"/>
</Button.Background>
</Button>
<TextBlock HorizontalAlignment="Left" TextWrapping="Wrap" Text="Baby_bayi_nangis" VerticalAlignment="Bottom" Margin="94,0,0,4" RenderTransformOrigin="2.13,1.496" Height="43" Width="270" Foreground="#FF0F0F0F" FontSize="30" FontFamily="Segoe WP Semibold"/>
</Grid>
<!--3-->
<Grid Tap="Grid_Tap_3">
<Button BorderBrush="LightGray" BorderThickness="0" Content="" Click="Button_Click_3" HorizontalAlignment="Left" VerticalAlignment="Top" Width="114" Margin="-20,-24,0,-18" Height="122">
<Button.Background>
<ImageBrush Stretch="Fill" ImageSource="/images/c.png"/>
</Button.Background>
</Button>
<TextBlock HorizontalAlignment="Left" TextWrapping="Wrap" Text="Baby_Gangster" VerticalAlignment="Bottom" Margin="94,0,0,4" RenderTransformOrigin="2.13,1.496" Height="43" Width="270" Foreground="#FF0F0F0F" FontSize="30" FontFamily="Segoe WP Semibold"/>
</Grid>
<!--4-->
<Grid Tap="Grid_Tap_4">
<Button BorderBrush="LightGray" BorderThickness="0" Content="" Click="Button_Click_4" HorizontalAlignment="Left" VerticalAlignment="Top" Width="114" Margin="-20,-24,0,-18" Height="122">
<Button.Background>
<ImageBrush Stretch="Fill" ImageSource="/images/e.png"/>
</Button.Background>
</Button>
<TextBlock HorizontalAlignment="Left" TextWrapping="Wrap" Text="Boss_Sms_Tone" VerticalAlignment="Bottom" Margin="94,0,0,4" RenderTransformOrigin="2.13,1.496" Height="43" Width="270" Foreground="#FF0F0F0F" FontSize="30" FontFamily="Segoe WP Semibold"/>
</Grid>
<!--5-->
<Grid Tap="Grid_Tap_5">
<Button BorderBrush="LightGray" BorderThickness="0" Content="" Click="Button_Click_5" HorizontalAlignment="Left" VerticalAlignment="Top" Width="114" Margin="-20,-24,0,-18" Height="122">
<Button.Background>
<ImageBrush Stretch="Fill" ImageSource="/images/d.png"/>
</Button.Background>
</Button>
<TextBlock HorizontalAlignment="Left" TextWrapping="Wrap" Text="Cartoon_Laugh" VerticalAlignment="Bottom" Margin="94,0,0,4" RenderTransformOrigin="2.13,1.496" Height="43" Width="270" Foreground="#FF0F0F0F" FontSize="30" FontFamily="Segoe WP Semibold"/>
</Grid>
<!--6-->
<Grid Tap="Grid_Tap_6">
<Button BorderBrush="LightGray" BorderThickness="0" Content="" Click="Button_Click_6" HorizontalAlignment="Left" VerticalAlignment="Top" Width="114" Margin="-20,-24,0,-18" Height="122">
<Button.Background>
<ImageBrush Stretch="Fill" ImageSource="/images/h.png"/>
</Button.Background>
</Button>
<TextBlock HorizontalAlignment="Left" TextWrapping="Wrap" Text="Cute_kid_sms" VerticalAlignment="Bottom" Margin="94,0,0,4" RenderTransformOrigin="2.13,1.496" Height="43" Width="270" Foreground="#FF0F0F0F" FontSize="30" FontFamily="Segoe WP Semibold"/>
</Grid>
<!--7-->
<Grid Tap="Grid_Tap_7">
<Button BorderBrush="LightGray" BorderThickness="0" Content="" Click="Button_Click_7" HorizontalAlignment="Left" VerticalAlignment="Top" Width="114" Margin="-20,-24,0,-18" Height="122">
<Button.Background>
<ImageBrush Stretch="Fill" ImageSource="/images/j.png"/>
</Button.Background>
</Button>
<TextBlock HorizontalAlignment="Left" TextWrapping="Wrap" Text="Dad_is_calling" VerticalAlignment="Bottom" Margin="94,0,0,4" RenderTransformOrigin="2.13,1.496" Height="43" Width="270" Foreground="#FF0F0F0F" FontSize="30" FontFamily="Segoe WP Semibold"/>
<Button BorderBrush="LightGray" BorderThickness="0" Content="" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,0,-99,0" Width="100" Height="80">
</Grid>
<!--8-->
<Grid Tap="Grid_Tap_8">
<Button BorderBrush="LightGray" BorderThickness="0" Content="" Click="Button_Click_8" HorizontalAlignment="Left" VerticalAlignment="Top" Width="114" Margin="-20,-24,0,-18" Height="122">
<Button.Background>
<ImageBrush Stretch="Fill" ImageSource="/images/k.png"/>
</Button.Background>
</Button>
<TextBlock HorizontalAlignment="Left" TextWrapping="Wrap" Text="Funny_funny_funny" VerticalAlignment="Bottom" Margin="94,0,0,4" RenderTransformOrigin="2.13,1.496" Height="43" Width="270" Foreground="#FF0F0F0F" FontSize="30" FontFamily="Segoe WP Semibold"/>
</Grid>
<!--9-->
<Grid Tap="Grid_Tap_9">
<Button BorderBrush="LightGray" BorderThickness="0" Content="" Click="Button_Click_9" HorizontalAlignment="Left" VerticalAlignment="Top" Width="114" Margin="-20,-24,0,-18" Height="122">
<Button.Background>
<ImageBrush Stretch="Fill" ImageSource="/images/l.png"/>
</Button.Background>
</Button>
<TextBlock HorizontalAlignment="Left" TextWrapping="Wrap" Text="Funny_laugh" VerticalAlignment="Bottom" Margin="94,0,0,4" RenderTransformOrigin="2.13,1.496" Height="43" Width="270" Foreground="#FF0F0F0F" FontSize="30" FontFamily="Segoe WP Semibold"/>
</Grid>
<!--10-->
<Grid Tap="Grid_Tap_10">
<Button BorderBrush="LightGray" BorderThickness="0" Content="" Click="Button_Click_10" HorizontalAlignment="Left" VerticalAlignment="Top" Width="114" Margin="-20,-24,0,-18" Height="122">
<Button.Background>
<ImageBrush Stretch="Fill" ImageSource="/images/n.png"/>
</Button.Background>
</Button>
<TextBlock HorizontalAlignment="Left" TextWrapping="Wrap" Text="Funny_msg_tone" VerticalAlignment="Bottom" Margin="94,0,0,4" RenderTransformOrigin="2.13,1.496" Height="43" Width="270" Foreground="#FF0F0F0F" FontSize="30" FontFamily="Segoe WP Semibold"/>
</Grid>
<!--11-->
<Grid Tap="Grid_Tap_11">
<Button BorderBrush="LightGray" BorderThickness="0" Content="" Click="Button_Click_11" HorizontalAlignment="Left" VerticalAlignment="Top" Width="114" Margin="-20,-24,0,-18" Height="122">
<Button.Background>
<ImageBrush Stretch="Fill" ImageSource="/images/o.png"/>
</Button.Background>
</Button>
<TextBlock HorizontalAlignment="Left" TextWrapping="Wrap" Text="Funny_sms" VerticalAlignment="Bottom" Margin="94,0,0,4" RenderTransformOrigin="2.13,1.496" Height="43" Width="270" Foreground="#FF0F0F0F" FontSize="30" FontFamily="Segoe WP Semibold"/>
</Grid>
</Grid>
Cs File code:
public MainPage()
{
InitializeComponent();
}
private void Grid_Tap_1(object sender, System.Windows.Input.GestureEventArgs e)
{
m1.Source = new Uri("/Answer_the_Phone.mp3", UriKind.Relative);
m1.Play();
}
private void Grid_Tap_2(object sender, System.Windows.Input.GestureEventArgs e)
{
m1.Source = new Uri("/baby_bayi_nangis.mp3", UriKind.Relative);
m1.Play();
}
private void Grid_Tap_3(object sender, System.Windows.Input.GestureEventArgs e)
{
m1.Source = new Uri("/Baby_Gangster.mp3", UriKind.Relative);
m1.Play();
}
private void Grid_Tap_4(object sender, System.Windows.Input.GestureEventArgs e)
{
m1.Source = new Uri("/Boss_Sms_Tone.mp3", UriKind.Relative);
m1.Play();
}
private void Grid_Tap_5(object sender, System.Windows.Input.GestureEventArgs e)
{
m1.Source = new Uri("/Cartoon_Laugh.mp3", UriKind.Relative);
m1.Play();
}
private void Grid_Tap_6(object sender, System.Windows.Input.GestureEventArgs e)
{
m1.Source = new Uri("/Cute_Kid_Sms.mp3", UriKind.Relative);
m1.Play();
}
private void Grid_Tap_7(object sender, System.Windows.Input.GestureEventArgs e)
{
m1.Source = new Uri("/Dad_Is_Calling.mp3", UriKind.Relative);
m1.Play();
}
private void Grid_Tap_8(object sender, System.Windows.Input.GestureEventArgs e)
{
m1.Source = new Uri("/Funny_Funny_Funny_09.mp3", UriKind.Relative);
m1.Play();
}
private void Grid_Tap_9(object sender, System.Windows.Input.GestureEventArgs e)
{
m1.Source = new Uri("/Funny_Laugh.mp3", UriKind.Relative);
m1.Play();
}
private void Grid_Tap_10(object sender, System.Windows.Input.GestureEventArgs e)
{
m1.Source = new Uri("/funny_msg_tone.mp3", UriKind.Relative);
m1.Play();
}
private void Grid_Tap_11(object sender, System.Windows.Input.GestureEventArgs e)
{
m1.Source = new Uri("/Funny_Sms.mp3", UriKind.Relative);
m1.Play();
}
Hope this will help u.
Thnx....!!!