IWMDMDeviceControl::Record method (mswmdm.h)

The Record method begins recording from the device's external record input at the current seek position. The IWMDMDeviceControl::Seek method must be called first.

Syntax

HRESULT Record(
  [in] _WAVEFORMATEX *pFormat
);

Parameters

[in] pFormat

Pointer to a _WAVEFORMATEX structure specifying the format in which the data must be recorded.

Return value

The method returns an HRESULT. Possible values include, but are not limited to, those in the following table.

Return code Description
S_OK
The method succeeded.
E_BUSY
The device is already performing an operation.
WMDM_E_NOTSUPPORTED
The record function is not implemented on this device.
E_FAIL
An unspecified error occurred.

Remarks

This method is used to invoke both device recording (recording of an audio track to be stored on the media device) and streaming audio data from the media device to be recorded on the computer. The Seek method determines which form of recording occurs.

Some devices do not support either type of recording. The GetCapabilities method must be called before you start recording. If an unsupported type of recording is attempted, this method returns WMDM_E_NOTSUPPORTED.

An argument can be supplied for the pFormat parameter to specify an audio format for recording. To determine the formats supported by the device, see GetFormatSupport. If the pFormat parameter is set to NULL, the device records audio data in the default format.

When you use device recording, you must enumerate the storage medium contents to find the new object after the record operation is finished.

Requirements

Requirement Value
Target Platform Windows
Header mswmdm.h
Library Mssachlp.lib

See also

IWMDMDevice::GetFormatSupport

IWMDMDeviceControl Interface

IWMDMDeviceControl::GetCapabilities

IWMDMDeviceControl::Seek

IWMDMObjectInfo Interface

_WAVEFORMATEX