Skip to main content
gamedev.net
🔒 Locked

Problem using CaptureBuffer in Windows 7

Started by jensenflemming Jan 18, 2010 at 11:21 AM 1 replies 2k views
Original Post
jensenflemming
jensenflemming
My app runs fine on Windows XP but when I try running it on Windows 7 i run into this problem: (Offcourse I had to update my DirectX first in order for the app to find DirectSound.dll) When these lines are executed: WaveFormat format = new WaveFormat(); format.Channels = ChannelCount; format.BitsPerSample = BitsPerSample; format.SamplesPerSecond = SampleRate; format.FormatTag = WaveFormatTag.Pcm; format.BlockAlign = (short)((format.Channels * format.BitsPerSample + 7) / 8); format.AverageBytesPerSecond = format.BlockAlign * format.SamplesPerSecond; bufferLength = format.AverageBytesPerSecond * BufferSeconds; CaptureBufferDescription description = new CaptureBufferDescription(); description.Format = format; description.BufferBytes = bufferLength; capture = new Capture(device.Id); buffer = new CaptureBuffer(description, capture); The application goes out with the following exception when creating the CaptureBuffer (the last line) This CaptureBuffer wasn't created using the DSBCAPS_CONTROLPOSITIONNOTIFY flag. System.ArgumentException: This CaptureBuffer wasn't created using the DSBCAPS_CTRLPOSITIONNOTIFY flag. ved Microsoft.DirectX.DirectSound.Notify..ctor(CaptureBuffer lp) There are no properties where I can specify this flag on the description object... Anybody knows how to resolve this problem???
unbird
unbird
Used a very similar code, including some notification logic, which works well on XP.

Just dug into the MDX code and yes, the creation flags are hidden. Don't know how to circumvent that yet :-(. Big nuisance.

Looked at SlimDX, but as far as I can tell from the docs, the wrapper for CaptureBufferDescription looks very similar in this respect, i.e. flags are hidden, too, unfortunately.

Or am I missing something else ? According to the DirectX docs, the flags list DSCBCAPS_CTRLFX, DSCBCAPS_WAVEMAPPED for capturing buffers, the DSBCAPS_CTRLPOSITIONNOTIFY is only listed for play buffers. So the flags can't/shouldn't be mixed then ? Why that error then ?

My next approach would be to see if something can be done earlier, i.e. at device creation.

I'm using XP for now, but for upgrade compatibility, I'd be very interested in a solution too.

[Edited by - unbird on January 21, 2010 1:42:20 PM]
jensenflemming
jensenflemming
Thanks for the reply...

Glad to hear that it isn't just me who is going crazy.

This must be something solveable - i guess somebody will find a solution at some point.

BR Flemming

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.