voice modem WaveIn CaptureDevice

I am developing an answering machine in C# using TAPI 3.0 and
Microsoft's mananged DirectX 9.

I am answering the phone, getting an ITBasicCallControl object from the
ITCallInfo object which I set with the Call property on the
ITCallNotificationEvent object I receive when the call comes in.

I am trying to create a DirectX.DirectSound.CaptureBuffer with my voice
modem's WaveIn device, but it is failing. Below is my code:

ITLegacyCallMediaControl2 mediaControl =
int deviceID = BitConverter.ToInt32( (byte
[])mediaControl.GetIDAsVariant( "wave/in" ), 0 );

Guid waveInGuid = Guid.Empty;

// Get the driver guid for the modem's WaveIn

CaptureDevicesCollection captureDeviceCollection = new

for ( int i = 0; i < captureDeviceCollection.Count && waveInGuid ==
Guid.Empty; i++ )
DeviceInformation deviceInformation = captureDeviceCollection[ i ];

if ( Regex.Match( deviceInformation.ModuleName, "WaveIn 1" ).Success
waveInGuid = deviceInformation.DriverGuid;

Microsoft.DirectX.DirectSound.Capture captureDevice = new

Microsoft.DirectX.DirectSound.Capture( waveInGuid );

// Set up the WaveFormat
WaveFormat format = new WaveFormat();
format.SamplesPerSecond = 8000;
format.BitsPerSample = 8;
format.Channels = 1;
format.BlockAlign = (short)( format.Channels * ( format.BitsPerSample /
8 ) );
format.AverageBytesPerSecond = format.BlockAlign *
format.FormatTag = WaveFormatTag.Pcm;

CaptureBufferDescription captureBufferDescription = new
captureBufferDescription.BufferBytes = format.AverageBytesPerSecond;
captureBufferDescription.Format = format;

CaptureBuffer captureBuffer = new CaptureBuffer(
captureBufferDescription, captureDevice );

On the above line, I get a

"An unhandled exception of type
'Microsoft.DirectX.DirectSound.BadFormatException' occurred in

Additional information: Error in the application."

I don't have any trouble creating a CaptureBuffer with the "Primary
Sound Capture Driver", so it looks like there is either a problem with
the WaveFormat struct I am using, or something else with the modem's
WaveIn device.

Any help that can be given will be appreciated.