📄 wmaudio.h
字号:
/* * WMAFileCBGetData * ================ * * Description * ----------- * Supplies more data to the WMAudio decoder. Not implemented by * the WMAudio decoder library. * * It is a callback function implemented by the application. When * the WMAudio library needs more data to process (both to parse * informatio and to decode the actual data bitstream), the library * will call this function. * * Called by WMAFileDecodeInit(), WMAFileContentDesc() and * WMAFileDecodeData(). * * Syntax * ------ * tWMA_U32 WMAFileCBGetData(tHWMAFileState hstate, * tWMA_U32 offset, * tWMA_U32 num_bytes, * unsigned char **ppData); * * where: * * state pointer to the structure that holds the internal * state of the WMAudio decoder * offset offset into the WMA file to get the data from * num_bytes how many bytes to get * ppData pointer to contain the returned buffer with more * data * The WMA library may over-write this buffer * * Return Value * ------------ * tWMA_U32 how many actually returned * should be same as num_bytes except for at the * very end of the file * */extern tWMA_U32 WMAFileCBGetData ( tHWMAFileState hstate, tWMA_U32 offset, tWMA_U32 num_bytes, unsigned char **ppData);/* * WMAFileCBGetLicenseData * ======================= * * Description * ----------- * Supplies more data to the WMAudio DRM decryption function. Not * implemented by the WMAudio decoder library. * * It is a callback function implemented by the application. When * the WMAudio's DRM decryption library needs more data to process * the library will call this function. * * Called by WMAFileLicenseInit(). * * Syntax * ------ * tWMA_U32 WMAFileCBGetLicenseData(tHWMAFileState *state, * tWMA_U32 offset, * tWMA_U32 num_bytes, * unsigned char **ppData); * * where: * * state pointer to the structure that holds the internal * state of the WMAudio decoder * offset offset into the license file to get the data from * num_bytes how many bytes to get * ppData pointer to contain the returned buffer with more * data * * Return Value * ------------ * tWMA_U32 how many actually returned * should be same as num_bytes except for at the * very end of the file * */extern tWMA_U32 WMAFileCBGetLicenseData ( tHWMAFileState *pstate, tWMA_U32 offset, tWMA_U32 num_bytes, unsigned char **ppData);/* * WMAFileDecodeCreate * =================== * * Description * ----------- * Create the WMAudio decoder. * * Must be called before starting to decode a WMA file. * * Syntax * ------ * tWMAFileStatus WMAFileDecodeCreate(tHWMAFileState *state); * * where: * * phstate pointer to the handle that holds the internal * state of the WMAudio decoder * * Return Value * ------------ * cWMA_NoErr decoder created * cWMA_Failed Memory allocation failed * cWMA_BadArgument Bad argument passed in * */tWMAFileStatus WMAFileDecodeCreate (tHWMAFileState* phstate);/* * WMAFileDecodeInit * ================= * * Description * ----------- * Initializes the WMAudio decoder. * * Must be called before starting to decode a WMA file. * * Syntax * ------ * tWMAFileStatus WMAFileDecodeInit(tHWMAFileState state); * * where: * * phstate pointer to the handle that holds the internal * state of the WMAudio decoder * This memory should be cleared before the first call * to WMAFileDecodeInit * * Return Value * ------------ * cWMA_NoErr decoder initialised * cWMA_BadArgument bad argument passed in * cWMA_BadAsfHeader bad ASF header * cWMA_BadSamplingRate invalid or unsupported sampling rate * cWMA_BadNumberOfChannels invalid or unsupported number of channels * cWMA_BadVersionNumber invalid or unsupported version number * cWMA_BadWeightingMode invalid or unsupported weighting mode * cWMA_BadPacketisation invalid or unsupported packetisation * cWMA_BadDRMType unknown encryption type * cWMA_DRMFailed DRM failed * cWMA_DRMUnsupported DRM is not supported for this version * *///tWMAFileStatus WMAFileDecodeInit (tHWMAFileState phstate); //sigmatWMAFileStatus WMAFileDecodeInit (tHWMAFileState phstate, unsigned short cPlayerOpt);tWMAFileStatus WMAFileDecodeClose (tHWMAFileState* phstate);/* * WMAFileDecodeInfo * ================= * * Description * ----------- * Retrieves the header information for the WMA file. * * Syntax * ------ * tWMAFileStatus WMAFileDecodeInfo(tHWMAFileState hstate, * tWMAFileHeader *hdr); * * where: * * state pointer to the structure that holds the internal * state of the WMAudio decoder * hdr pointer to the structure that holds the WMA file * header info * * Return Value * ------------ * cWMA_NoErr header retrieved ok * cWMA_BadArgument bad argument(s) * */tWMAFileStatus WMAFileDecodeInfo (tHWMAFileState hstate, tWMAFileHeader *hdr);/* * WMAFileContentDesc * ================== * * Description * ----------- * Retrieves the content description for the WMA file. Content * descriptions are such as the song title, the author, the * copyright info, the song description, and the rating info. * All these are part of the standard ASF description. * * Not all songs have content descriptions. * * Syntax * ------ * tWMAFileStatus WMAFileContentDesc(tHWMAFileState hstate, * tWMAFileContDesc *desc); * * where: * * state pointer to the structure that holds the internal * state of the WMAudio decoder * desc pointer to the structure that holds the WMA file * content description info * as [in], must provide the buffer(s) and the size(s) * * Return Value * ------------ * cWMA_NoErr description retrieved ok * cWMA_BadArgument bad argument(s) * cWMA_BadAsfHeader bad ASF header * */tWMAFileStatus WMAFileContentDesc (tHWMAFileState hstate, tWMAFileContDesc *desc);/* WMAFileExtendedContentDesc * * Description * ----------- * Retrieves the extended content descriptions for the ASF file. * Not all ASF files have extended content descriptions. * * Syntax * ------ * tWMAFileStatus WMAFileExtendedContentDesc (tHWMAFileState hstate, const tWMAExtendedContentDesc **pECDesc); * * where: * * hstate Pointer to the structure that holds the internal * state of the WMAudio decoder * pECDesc pointer of pointer to the Extended Content Desc * structure that holds in the ASF file. * * Return Value * ------------ * cWMA_NoErr description retrieved ok * cWMA_BadArgument bad argument(s) * pECDesc is the pointer of pointer to the ASF extended content desc object. ***** DO NOT RELEASE THIS POINTER ************* */tWMAFileStatus WMAFileExtendedContentDesc (tHWMAFileState hstate, const tWMAExtendedContentDesc **pECDesc);/* * WMAFileLicenseInit * ================== * * Description * ----------- * Reads the DRM license file and check the license for the file. * * Uses WMAFileCBGetLicenseData to retrieve the license file. * * Syntax * ------ * tWMAFileStatus WMAFileLicenseInit(tHWMAFileState hstate, * tWMAFileLicParams *lic_params); * * where: * * state pointer to the structure that holds the internal * state of the WMAudio decoder * lic_params pointer to the structure that passes in the * parameters for the license initialization. * * Return Value * ------------ * cWMA_NoErr license checked ok * cWMA_BadArgument bad argument * cWMA_DRMFailed no license * cWMA_DRMUnsupported DRM is not supported for this version * */tWMAFileStatus WMAFileLicenseInit (tHWMAFileState hstate, tWMAFileLicParams *lic_params, tWMA_U16 CheckLicTypes);/* * WMAFileDecodeData * ================= * * Description * ----------- * Decodes WMAudio bitstream. * * Syntax * ------ * tWMAFileStatus WMAFileDecodeData(tHWMAFileState hstate, tWMA_U32 *pnDecodedSamples); * * where: * * state pointer to the structure that holds the internal * state of the WMAudio decoder * pnDecodedSamples pointer to the number of samples decoded by this call. * * Return Value * ------------ * cWMA_NoErr frame decoded ok * cWMA_BadArgument bad argument * cWMA_BrokenFrame data is inconsistent * cWMA_NoMoreFrames no more data to decode * */tWMAFileStatus WMAFileDecodeData (tHWMAFileState hstate, tWMA_U32 *pnDecodedSamples);/* * WMAFileGetPCM * ============= * * Description * ----------- * Write PCM samples from the WMAudio bitstream previously decoded by * WMAFileDecodeData(). * * WMAFileGetPCM() may have to be called more than once to obtain all * of the samples for the frame. The frame is complete when the number * of samples written is less than the number of samples requested. * * Syntax * ------ * tWMA_U32 WMAFileGetPCM(tHWMAFileState hstate, * tWMA_I16 *left, tWMA_I16 *right, * tWMA_U32 max_nsamples); * * where: * * state pointer to the structure that holds the internal * state of the WMAudio decoder * pi16Channel0 pointer to output buffer for left-channel PCM, or the entire PCM output if it is inter-leaved form * pi16Channel1 pointer to output buffer for right-channel PCM, NULL if the output PCM is in parallel form * max_nsamples maximum number of samples to write per channel * * Return Value * ------------ * tWMA_U32 number of samples written * < max_nsamples when frame complete * */tWMA_U32 WMAFileGetPCM ( tHWMAFileState hstate, tWMA_I16 *pi16Channel0, tWMA_I16 *pi16Channel1, tWMA_U32 max_nsamples);/* * WMAFileSeek * =========== * * Description * ----------- * Seek to a time into the WMA file. It seeks to the nearest seek * point. * * Syntax * ------ * tWMA_32 WMAFileSeek(tHWMAFileState hstate, * tWMA_U32 msSeek); * * where: * * state pointer to the structure that holds the internal * state of the WMAudio decoder * msSeek time position to seek from the beginning of the * clip, in milliseconds * * Return Value * ------------ * tWMA_32 actual time position from the beginning of the * clip, in milliseconds * */tWMA_U32 WMAFileSeek (tHWMAFileState hstate, tWMA_U32 msSeek);/* * WMADebugMessage * =============== * * Description * ----------- * Display a debugging message. This function needs to be implemented by the app that calls WMEPAK. * These messages are meant for the device/application developer, not the end user. * Display the message using fprintf, messagebox, or whatever method is suitable to your platform. * See the sample code for an example implementation. * Make it a empty-body function if the intent is to skip this operation. * * Syntax * ------ * WMADebugMessage(const char* pszFmt, * ...); * * where: * * pszFmt pointer to a null terminated printf like format string * ... variable number of arguments referenced by the format string * * Return Value * ------------ * none * */extern void WMADebugMessage (const char*pszFmt, ...);#ifdef __cplusplus}#endif /* __cplusplus *//*#ifdef USE_PACK_HEADERS#include <poppack.h>#endif*/#endif /* _WMAUDIO_API_H_ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -