Hello!

I am programming a audiorecorder with MCI. My 2 problems are:

First problem:
If i stop recording and want to record more after stopposition i get no error and MCI don't start recording.

The MCI-Commands i fire (c#):

int bytesPerSecond = ((int)bitsPerSample * (int)samplesPerSec * (int)channels)/8;
int alignment = ((int)bitsPerSample * (int)channels) / 8;

mciSendStringA("open new type waveaudio alias " + deviceGuid.ToString(), null, 0, IntPtr.Zero);
mciSendStringA("set " + deviceGuid.ToString() + " time format ms format tag pcm " + " bitspersample " + (int)bitsPerSample + " samplespersec " + (int)samplesPerSec + " channels " + (int)channels + " bytespersec " + bytesPerSecond + " alignment " + alignment.ToString(), null, 0, IntPtr.Zero);
mciSendStringA("record " + deviceGuid.ToString() + " from " + position.ToString() + " insert", null, 0, IntPtr.Zero);
mciSendStringA("stop " + deviceGuid.ToString(), null, 0, IntPtr.Zero);
mciSendStringA("record " + deviceGuid.ToString() + " from " + position.ToString() + " insert", null, 0, IntPtr.Zero);

On second call of record it not record. If i change position i can record. If i say stop i can't also record

Second problem:
If i switch between insert, overwrite i can with following command record after end of recording:
mciSendStringA("record " + deviceGuid.ToString() + " overwrite", null, 0, IntPtr.Zero);

But if i switch insert, overwrite, insert and want overwrite the application crashes at the moment if recording reach end of recorded data.



Can anyone help me?

Cu
emilmaier2