0

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.

Dor Cohen
  • 16,769
  • 23
  • 93
  • 161
DoNNie_DarkO
  • 367
  • 3
  • 5
  • 15

1 Answers1

1

This Link seems to define what your looking for. It looks like a custom class to me.

And here is the class...

Mixxiphoid
  • 1,044
  • 6
  • 26
  • 46