I have the following problem: I just want to play a short sound but I hear nothing. The soundfile's property "Copy to output directory" says "Copy always". Strangely when I copy a existing and working example nothing happens but the original works. I can't find my problem.
Additionally systemsound don't work either.
Any ideas?
Thank you!!
using System.Media;
using System.Windows.Input;
using Microsoft.Windows.Controls.Ribbon;
namespace WpfRibbonApplication14
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : RibbonWindow
{
SoundPlayer player = new SoundPlayer("sound.wav");
public MainWindow()
{
InitializeComponent();
player.LoadAsync();
// Insert code required on object creation below this point.
}
private void Button1_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
player.Play();
}
}
}