Partager via


IDirectSoundCaptureBuffer8::Start Method

[The feature associated with this page, DirectSound, is a legacy feature. It has been superseded by WASAPI and Audio Graphs. Media Casting have been optimized for Windows 10 and Windows 11. Microsoft strongly recommends that new code use Media Casting instead of DirectSound, when possible. Microsoft suggests that existing code that uses the legacy APIs be rewritten to use the new APIs if possible.]

The Start method begins capturing data into the buffer. If the buffer is already capturing, the method has no effect.

Syntax

HRESULT Start(
         DWORD dwFlags
)

Parameters

  • dwFlags
    Flags that specify the behavior of the buffer when capturing sound data. The following flag is defined:
    Value Description
    DSCBSTART_LOOPING After the end of the buffer is reached, capture restarts at the beginning and continues until explicitly stopped.

Return Value

If the method succeeds, the return value is DS_OK. If the method fails, the return value may be one of the following error values:

Return code
DSERR_INVALIDPARAM
DSERR_NODRIVER
DSERR_OUTOFMEMORY

Remarks

If the buffer is already capturing, a call to this method using a different value in dwFlags might not change the value returned by GetStatus.

If the application is multithreaded, the thread that starts the buffer must continue to exist as long as the buffer is capturing. Buffers created on WDM drivers stop capturing when the thread is terminated.

Requirements

Header: Declared in DSound.h.

Library: Use Dsound3d.dll.

See Also

IDirectSoundCaptureBuffer8