I tried to play a mp3 file from relative folder. I defined xaml look like.
<MediaElement x:Name="background_Sound" Source="\Music\Background_sound.mp3" LoadedBehavior="Pause" Volume="0.3" />
I want to play this file when the form open:
public MainWindow()
{
InitializeComponent();
background_Sound.LoadedBehavior = MediaState.Play;
}
But nothing happens. I tried full path other mp3 Source = "E:\test.mp3", it worked well.
I tried to find more solutions from internet. Can you give me your advance. Thank you so much.