ACMDM_FORMAT_DETAILS

The ACMDM_FORMAT_DETAILS message requests an ACM driver to return information about a format associated with a specified format tag.

Parameters

dwDriverID
Driver instance identifier. This is the value returned by the driver in response to the DRV_OPEN message.
hDriver
Driver handle.
uMsg
ACMDM_FORMAT_DETAILS
lParam1
Pointer to an ACMFORMATDETAILS structure. (ACMFORMATDETAILS is defined in msacm.h and described in the Win32 SDK.)
lParam2
Contains one of the following flags, specified by the fdwDetails parameter of the acmFormatDetails function, which is described in the Win32 SDK:

Flag

Meaning

ACM_FORMATDETAILSF_INDEX

Indicates the dwFormatIndex member of the ACMFORMATDETAILS structure contains a format index. The valid index range is from zero to one less than the cStandardFormats member returned in the ACMFORMATTAGDETAILS structure for the format tag. (See ACMDM_FORMATTAG_DETAILS.)

ACM_FORMATDETAILSF_FORMAT

Indicates the client has filled in the WAVEFORMATEX structure associated with the ACMFORMATDETAILS structure.

Return Value

The driver should return MMSYSERR_NOERROR if the operation succeeds. Otherwise it should return one of the MMSYSERR error codes defined in mmsystem.h, or one of the ACMERR error codes defined in msacm.h. Possible error codes include:

Error Code

Meaning

MMSYSERR_NOTSUPPORTED

The driver does not support the specified query operation.

ACMERR_NOTPOSSIBLE

The input parameter values do not represent a valid format or format tag.

Comments

A client sends the ACMDM_FORMAT_DETAILS message by calling the driver’s DriverProc entry point, passing the specified parameters. The ACM sends this message when an application calls the acmFormatDetails function, which is described in the Win32 SDK.

All ACM drivers must support this message.

The client can do either of the following:

The client specifies the format tag in the ACMFORMATDETAILS structure’s dwFormatTag member. The driver returns information for a particular format belonging to the format tag, as follows:

Before calling the driver’s DriverProc function, the ACM verifies that:

Before returning, the driver must set the ACMFORMATDETAILS structure’s cbStruct member to the actual number of bytes returned. The value returned in cbStruct must not be greater than the value received.

The WAVEFORMATEX Structure

The WAVEFORMATEX structure is a generic structure for describing a waveform format. Generally, you will use this structure as a basis for defining structures for your specific format types, as has been done in the IMA ADPCM Audio Codec. (For an example, see IMAADPCMWAVEFORMAT in mmreg.h.) When a client sends an ACMDM_FORMAT_DETAILS message, it specifies the address of a structure that you have defined for the specified format type. This structure is typically larger than the generic WAVEFORMATEX structure.

For more information about format tags and format structures, see Format Tags and Filter Tags and Defining Format Structures and Filter Structures.

Returning a Description String

The WAVEFORMATEX structure’s szFormat member is used for returning a format description string. If an ACM driver returns a zero-length string in szFormat, the ACM creates an internationalized description string for the format. This string includes the format’s speed (in Hz), bit depth, and channel setting (mono or stereo), based on the contents of the nSamplesPerSec, wBitsPerSample, and nChannels members of the WAVEFORMATEX structure. If wBitsPerSample contains zero, the ACM does not include the bit depth in the description string. You can provide your own description string and return it in szFormat, but allowing ACM to generate an internationalized string is preferred.