acmFormatSuggest
The acmFormatSuggest function queries the ACM or a specified ACM driver to suggest a destination format for the supplied source format. For example, an application can use this function to determine one or more valid PCM formats to which a compressed format can be decompressed.
MMRESULT acmFormatSuggest(
HACMDRIVER had,
LPWAVEFORMATEX pwfxSrc,
LPWAVEFORMATEX pwfxDst,
DWORD cbwfxDst,
DWORD fdwSuggest
);
Parameters
-
had
-
Handle of an open instance of a driver to query for a suggested destination format. If this parameter is NULL, the ACM attempts to find the best driver to suggest a destination format.
-
pwfxSrc
-
Address of a WAVEFORMATEX structure that identifies the source format for which a destination format will be suggested by the ACM or specified driver.
-
pwfxDst
-
Address of a WAVEFORMATEX structure that will receive the suggested destination format for the pwfxSrc format. Depending on the fdwSuggest parameter, some members of the structure pointed to by pwfxDst may require initialization.
-
cbwfxDst
-
Size, in bytes, available for the destination format. The acmMetrics and acmFormatTagDetails functions can be used to determine the maximum size required for any format available for the specified driver (or for all installed ACM drivers).
-
fdwSuggest
-
Flags for matching the desired destination format. The following values are defined:
-
ACM_FORMATSUGGESTF_NCHANNELS
-
The nChannels member of the structure pointed to by pwfxDst is valid. The ACM will query acceptable installed drivers that can suggest a destination format matching nChannels or fail.
-
ACM_FORMATSUGGESTF_NSAMPLESPERSEC
-
The nSamplesPerSec member of the structure pointed to by pwfxDst is valid. The ACM will query acceptable installed drivers that can suggest a destination format matching nSamplesPerSec or fail.
-
ACM_FORMATSUGGESTF_WBITSPERSAMPLE
-
The wBitsPerSample member of the structure pointed to by pwfxDst is valid. The ACM will query acceptable installed drivers that can suggest a destination format matching wBitsPerSample or fail.
-
ACM_FORMATSUGGESTF_WFORMATTAG
-
The wFormatTag member of the structure pointed to by pwfxDst is valid. The ACM will query acceptable installed drivers that can suggest a destination format matching wFormatTag or fail.
Return Values
Returns zero if successful or an error otherwise. Possible error values include the following:
Value |
Description |
MMSYSERR_INVALFLAG |
At least one flag is invalid. |
MMSYSERR_INVALHANDLE |
The specified handle is invalid. |
MMSYSERR_INVALPARAM |
At least one parameter is invalid. |
QuickInfo
Windows NT: Requires version 3.1 or later.
Windows: Requires Windows 95 or later.
Windows CE: Unsupported.
Header: Declared in msacm.h.
Import Library: Use msacm32.lib.
See Also
Audio Compression Manager Overview, Audio Compression Functions, WAVEFORMATEX, acmMetrics, acmFormatTagDetails