I have a double array includes the waves and I want to play it. First I tried this code(for just one wave):
private void DoPlaySound(double p)
{
double[] d=new double[1]{p};
Complex[] c=(DoubleToComplex(d)).ToArray();
FourierTransform.DFT(c,FourierTransform.Direction.Forward);
Stream s = Stream.Null;
StreamWriter w = new StreamWriter(s);
w.Write(c[0].Re);
w.Close();
System.Media.SoundPlayer sndp = new SoundPlayer(s);
sndp.PlayLooping();
}
but System.Media.SoundPlayer.PlayLooping() Needs Wave Header and I haven’t any header and I don’t know how to generate it.
I also tried it but I don’t know how to play wave file using winmm
Try use NAduio