Author Topic: SOLVED WaveWriter in 'using' construct doesn't work  (Read 717 times)

aybe

  • Posts: 145
If I remove the using construct, the file is created, otherwise not.

This works;
Code: [Select]
           float[] sine2 = GetSine2(1000, 44100, 10);
            WaveWriter waveWriter = new WaveWriter("f:\\test.wav", 1, 44100, 32, true);
            
            waveWriter.Write(sine2, sine2.Length * 4);
            waveWriter.Close();


This doesn't, removing Close() doesn't help further
Code: [Select]
           float[] sine2 = GetSine2(1000, 44100, 10);
            using (WaveWriter waveWriter = new WaveWriter("f:\\test.wav", 1, 44100, 32, true))
            {
                waveWriter.Write(sine2, sine2.Length * 4);
                waveWriter.Close();
            }



I should have read better  ;D

Only call this method, if you want to discard the FileName created and physically delete it.
« Last Edit: 23 Apr '10 - 01:29 by aybe »