Code bellow is given in the sample.
SpeechStreamFileMode SpFileMode = SpeechStreamFileMode.SSFMCreateForWrite;
SpFileStream SpFileStream = new SpFileStream();
SpFileStream.Open(@"C:\test.wav", SpFileMode, false);
voice.AudioOutputStream = SpFileStream;
voice.Speak(textBox1.Text.Trim(), flag);
voice.WaitUntilDone(Timeout.Infinite);
SpFileStream.Close()