I am creating a small application to help me better understand how to play sounds on WP7 devices, but I had a problem with sound output from the device.
I have the following code:
<MediaElement x:Name="note1" Source="test.mp3" AutoPlay="False" />
private void btn1_Click(object sender, RoutedEventArgs e)
{
note1.Source = new Uri("test.mp3", UriKind.Relative);
note1.Play();
}
Where test.mp3 Build Action is a resource.
What I do not understand is when I add a breakpoint in the btn1_Click method and stop at note1.Play (), it actually plays test.mp3, but when I debug without breakpoints and click on the button, I don’t hear anything.
Is there any way to fix this problem?
source
share