acmStreamConvert(3mms) — Subroutines
Name
acmStreamConvert --- Request the ACM to perform a conversion
Syntax
#include <mme/mme_api.h>
MMRESULT acmStreamConvert(HACMSTREAM has,
LPACMSTREAMHEADER pash,
DWORD fdwConvert)
Arguments
HACMSTREAM has
Identifies the open conversion stream.
LPACMSTREAMHEADER pash
Specifies a pointer to a stream header that describes source and destination buffers for a conversion. This header must have been prepared previously using the acmStreamPrepareHeader function.
The pash argument must be allocated with the mmeAllocMem function. See mmeAllocMem (3mms) for more information about memory allocation.
DWORD fdwConvert
Specifies the following flags for doing the conversion:
ACM_STREAMCONVERTF_BLOCKALIGN
This flag specifies that only integral numbers of blocks will be converted. Converted data will end on block-aligned boundaries. An application should use this flag for all conversions on a stream until there is not enough source data to convert to a block-aligned destination. In this case, the last conversion should be specified without this flag.
ACM_STREAMCONVERTF_START
This flag specifies that the ACM conversion stream should reinitialize its instance data. For example, if a conversion stream holds instance data, such as delta or predictor information, this flag will restore the stream to starting defaults. Note that this flag can be specified with the ACM_STREAMCONVERTF_END flag.
ACM_STREAMCONVERTF_END
This flag specifies that the ACM conversion stream should begin returning pending instance data. For example, if a conversion stream holds instance data, such as the tail end of an echo filter operation, this flag will cause the stream to start returning this remaining data with optional source data. Note that this flag can be specified with the ACM_STREAMCONVERTF_START flag.
The source and destination data buffers must be prepared with the acmStreamPrepareHeader function before they are passed to acmStreamConvert. The ACMSTREAMHEADER data structure and the source and destination data buffers pointed to by its pbSrc and pbDst fields must be allocated with the mmeAllocBuffer function.
Description
The acmStreamConvert function requests the Audio Compression Manager (ACM) to perform a conversion on the specified conversion stream.
Extensions
None.
Return Values
Returns zero if the function is successful; otherwise, it returns a nonzero error number or one of the following error codes:
MMSYSERR_INVALHANDLE@T{ The specified handle is invalid. T} MMSYSERR_INVALFLAG@T{ One or more flags is invalid. T} MMSYSERR_INVALPARAM@T{ One or more arguments passed is invalid. T} ACMERR_BUSY@T{ The stream header pash is currently in use and cannot be reused. T} ACMERR_UNPREPARED@T{ The stream header pash is currently not prepared by the acmStreamPrepareHeader function. T}