I found out a code on the net that plays a .wav file in C#. The code is as follows
private void btn_Play_Click(object sender, RoutedEventArgs e)
{
OpenFileDialog ofd = new OpenFileDialog();
if (ofd.ShowDialog().Value)
{
Stream s = ofd.File.OpenRead();
WaveMediaStreamSource wavMss = new WaveMediaStreamSource(s);
try
{
ME_Wav.SetSource(wavMss);
}
catch (InvalidOperationException)
{
// This file is not valid
}
}
}
But the error occurs " the type or namespace "WaveMediaStreamSource" could not be found". What is the namespace under which this is defined?
A very basic question it might be but I am just a beginer.
This Link seems to define what your looking for. It looks like a custom class to me.
And here is the class...