Hi Erel,
My recorder program crashes in the statement WaveIn.Save(RecPath & Now & ".wav"). The recording, however, is correctly saved. The error message is NullReferenceException.
In my program the recording can be stopped in two ways, either by the user clicking a button or by the program itself.
The elapsed time of the recording is monitored by the program using a timer and is compared with the maximum set in the statement WaveIn.Start(Duration*1000). When the maximum is reached, the program stops the recording
In both cases a routine is called which executes the the following two statements:
WaveIn.Stop
WaveIn.Save(RecPath & Now & ".wav")
The error occurs only when the user stops the recording, so before the maximum recording time has elapsed. When the program stops the recording everything is OK.
The detailed error information I got when running in debug mode on the device is:
Basic4PPC.exe
NullReferenceException
at WaveFile.InitBuffer()
at WaveFile.BlockDone()
at SoundMessageWindow.WndProc()
bij (dutch for at) Microsoft.WindowsCE.Forms.MessageWindow._WndProc()
bij Microsoft.AGL.Forms.EVL.EnterMainLoop()
bij System.Windows.Forms.Application.Run()
bij Dbasic.Form1.Main()
Any idea what is going wrong?
Harry
My recorder program crashes in the statement WaveIn.Save(RecPath & Now & ".wav"). The recording, however, is correctly saved. The error message is NullReferenceException.
In my program the recording can be stopped in two ways, either by the user clicking a button or by the program itself.
The elapsed time of the recording is monitored by the program using a timer and is compared with the maximum set in the statement WaveIn.Start(Duration*1000). When the maximum is reached, the program stops the recording
In both cases a routine is called which executes the the following two statements:
WaveIn.Stop
WaveIn.Save(RecPath & Now & ".wav")
The error occurs only when the user stops the recording, so before the maximum recording time has elapsed. When the program stops the recording everything is OK.
The detailed error information I got when running in debug mode on the device is:
Basic4PPC.exe
NullReferenceException
at WaveFile.InitBuffer()
at WaveFile.BlockDone()
at SoundMessageWindow.WndProc()
bij (dutch for at) Microsoft.WindowsCE.Forms.MessageWindow._WndProc()
bij Microsoft.AGL.Forms.EVL.EnterMainLoop()
bij System.Windows.Forms.Application.Run()
bij Dbasic.Form1.Main()
Any idea what is going wrong?
Harry