The tool for recording a .wav audio file is a MediaHandler called WaveStreamRecorder. This handle can be initialized by setting the filename (in local directory) or the file path of the file to be recorded into.

Code:
1.	WaveStreamRecorder WaveStreamRecorder;
You can specify the audio file by opening a SaveFileDialog window that is a standard window used by any .NET application. In this window you can set the file name and the path (by browsing).

Code:
1.	private void buttonSave_Click(object sender, EventArgs e)  
2.	{  
3.	    textBoxPlaybackFile.Text = string.Empty;  
4.	    using (SaveFileDialog sfd = new SaveFileDialog() { Filter = "Wave Files (*.wav)|*.wav", FileName = textBoxRecordingFile.Text })  
5.	    {  
6.	        if (sfd.ShowDialog() == System.Windows.Forms.DialogResult.OK)  
7.	            textBoxRecordingFile.Text = sfd.FileName;  
8.	    }  
9.	}
The audio stream can be recorded by pressing the Start button. You can pause and restart the recording with the same button. Pausing an audio recording means that the recording stops and when you start it again the audio data will be appended to the already saved audio.

Code:
1.	textBoxPlaybackFile.Text = string.Empty;  
2.	    if (WaveStreamRecorder == null)  
3.	    {  
4.	        if (string.IsNullOrEmpty(textBoxRecordingFile.Text))  
5.	            return; // Select a file first  
6.	  
7.	        WaveStreamRecorder = new WaveStreamRecorder(textBoxRecordingFile.Text);  
8.	        WaveStreamRecorder.Stopped += (WaveStreamRecorder_Stopped);  
9.	        microphone.Start();  
10.	        connector.Connect(microphone, WaveStreamRecorder);  
11.	        WaveStreamRecorder.IsStreaming = false;  
12.	    }  
13.	    if (!WaveStreamRecorder.IsStreaming)  
14.	    {  
15.	        buttonStartRecording.Text = "Pause";  
16.	        WaveStreamRecorder.IsStreaming = true;  
17.	        WaveStreamRecorder.StartStreaming();  
18.	    }  
19.	    else  
20.	    {  
21.	        buttonStartRecording.Text = "Start";  
22.	        WaveStreamRecorder.PauseStreaming();  
23.	        WaveStreamRecorder.IsStreaming = false;  
24.	    }
You can stop the audio recording by pressing the Stop button. In this case the audio file will be finalized and disposed and all the used devices and tools will be stopped, closed and set to the initial value.

Code:
1.	textBoxPlaybackFile.Text = string.Empty;  
2.	WaveStreamRecorder.StopStreaming();  
3.	connector.Disconnect(microphone, WaveStreamRecorder);  
4.	microphone.Stop();  
5.	WaveStreamRecorder.Dispose();  
6.	WaveStreamRecorder = null;  
7.	buttonStartRecording.Text = "Start";
With the above mentioned methods you can record an uncompressed .wav audio file using Ozeki VoIP SIP SDK. If you want to record a phone call, you will need to connect your recorder object to the PhoneCallAudioReceiver object. In this case you can record the incoming audio data. If you want to record both parties' voice, you will need an AudioMixerMediaHandler object.

I hope, you’ve liked this text.

Bye,
Niko