Float array of samples to WAV file format
<p>I am working on an application that applies filters on sound files, the filters are applied in frequency domain so I get the samples from the .wav file using NAudio library with this code :</p>

<pre><code>audio = new AudioFileReader(wav_file);
samples = new float[wave.Length];
audio.Read(samples, 0, samples.Length);
</code></pre>

<p>after applying the previous code, now I have the samples as an array of float, then I apply the short-time Fourier transform on the samples getting the frequency domain data, and then the filters are applied on the frequency domain data. <br>
and then the inverse short-time Fourier transform is applied on the frequency domain data to convert it back to time domain which should be similar to the initial samples but with the filters applied. <br>
the steps again: <br></p>

<ol>
<li>Get samples (time domain data) array from the wav file.</li>
<li>Apply short-time Fourier transform on the samples to get frequency domain data.</li>
<li>Apply filters on frequency domain data.</li>
<li>Apply inverse short-time Fourier transform on the frequency domain data to get samples (time domain data).</li>
<li>Convert samples into wav form back again to save and play it.</li>
</ol>

<p>now the problem is in the last step, I have the float array of samples (time domain data), how do I convert it into a .wav file and play it?</p>