|This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.|
Use the IDirectSoundCaptureBuffer::GetCapsmethod to retrieve the size of a capture buffer. Be sure to initialize the dwSizemember of the DSCBCAPSstructure before passing it as a parameter. You can also retrieve information about the format of the data in the buffer, as set when the buffer was created. Call the IDirectSoundCaptureBuffer::GetFormatmethod, which returns the format information in a WAVEFORMATEXstructure. For more information on this structure, see Sound Data.
Note that your application can allow for extra format information in the WAVEFORMATEXstructure by first calling the GetFormatmethod with NULL as the lpwfxFormatparameter. In this case the DWORDpointed to by the lpdwSizeWrittenparameter will receive the size of the structure needed to receive complete format information.
To find out what a capture buffer is currently doing, call the IDirectSoundCaptureBuffer::GetStatusmethod. This method fills a DWORDvariable with a combination of flags that indicate whether the buffer is busy capturing, and if so, whether it is looping; that is, whether the DSCBSTART_LOOPING flag was set in the last call to IDirectSoundCaptureBuffer::Start.
Finally, the IDirectSoundCaptureBuffer::GetCurrentPositionmethod returns the current read and capture positions within the buffer. The read position is the end of the data that has been captured into the buffer at this point. The capture position is the end of the block of data that is currently being copied from the hardware. You can safely copy data from the buffer only up to the read position.
Last updated on Tuesday, May 18, 2004