📄 wmaudio.h
字号:
//*@@@+++@@@@******************************************************************//// Microsoft Windows Media// Copyright (C) Microsoft Corporation. All rights reserved.////*@@@---@@@@******************************************************************/* * Windows Media Audio (WMA) Decoder API * * Copyright (c) Microsoft Corporation 1999. All Rights Reserved. */#ifndef _WMAUDIO_API_H_#define _WMAUDIO_API_H_#define PACKED/* ........................................................................... * * Types and Constants * =================== */#define CHECK_NONSDMI_LIC 1#define CHECK_SDMI_LIC 2#define CHECK_ALL_LICENSE 3#define WMA_MAX_DATA_REQUESTED 128enum { ECD_STRING = 0, ECD_BINARY = 1, ECD_BOOL = 2, ECD_DWORD = 3, ECD_QWORD = 4, ECD_WORD = 5};#if defined(_Embedded_x86)#pragma pack (1)#endif/* 8-bit signed type */#ifndef _WMAU8_DEFINED#define _WMAU8_DEFINEDtypedef unsigned char tWMA_U8;#endif /* _WMAU8_DEFINED *//* 16-bit signed type */#ifndef _WMAI16_DEFINED#define _WMAI16_DEFINEDtypedef short tWMA_I16;#endif /* _WMAI16_DEFINED *//* 16-bit unsigned type */#ifndef _WMAU16_DEFINED#define _WMAU16_DEFINEDtypedef short tWMA_U16;#endif /* _WMAU16_DEFINED *//* 32-bit unsigned type */#ifndef _WMAU32_DEFINED#define _WMAU32_DEFINEDtypedef unsigned long tWMA_U32;#endif /* _WMAU32_DEFINED *//* 32-bit signed type */#ifndef _WMAI32_DEFINED#define _WMAI32_DEFINEDtypedef long tWMA_I32;#endif /* _WMAI32_DEFINED *//* Bool */#ifndef _WMABool_DEFINED#define _WMABool_DEFINEDtypedef long tWMA_Bool;#endif /* _WMABool_DEFINED *//* 64-bit unsigned type */#ifndef _WMAU64_DEFINED#define _WMAU64_DEFINED#if defined(macintosh) || defined(_Embedded_x86)typedef unsigned long long tWMA_U64;#else//typedef unsigned __int64 tWMA_U64;typedef unsigned long long tWMA_U64; //SIGMA#endif#endif /* _WMAU64_DEFINED */#ifndef _QWORD_DEFINED#define _QWORD_DEFINEDtypedef PACKED struct tQWORD{ tWMA_U32 dwLo; tWMA_U32 dwHi;} QWORD;#endif /* _QWORD_DEFINED */#define DESC_NAME_MAX_LENGTH 64typedef struct _MarkerEntry { QWORD m_qOffset; QWORD m_qtime; tWMA_U16 m_wEntryLen; tWMA_U32 m_dwSendTime; tWMA_U32 m_dwFlags; tWMA_U32 m_dwDescLen; tWMA_U16 m_pwDescName[DESC_NAME_MAX_LENGTH];} MarkerEntry;typedef struct _ECD_DESCRIPTOR { tWMA_U16 cbName; tWMA_U16 *pwszName; tWMA_U16 data_type; tWMA_U16 cbValue; union { tWMA_U16 *pwszString; tWMA_U8 *pbBinary; tWMA_Bool *pfBool; tWMA_U32 *pdwDword; tWMA_U64 *pqwQword; tWMA_U16 *pwWord; } uValue;} ECD_DESCRIPTOR;typedef struct tagWMAExtendedContentDescription{ tWMA_U16 cDescriptors; // number of descriptors ECD_DESCRIPTOR *pDescriptors; // pointer to all the descriptors} tWMAExtendedContentDesc;/* status */#ifndef _WMAFILESTATUS_DEFINED#define _WMAFILESTATUS_DEFINEDtypedef enum tagWMAFileStatus{ cWMA_NoErr, /* -> always first entry */ /* remaining entry order is not guaranteed */ cWMA_Failed, cWMA_BadArgument, cWMA_BadAsfHeader, cWMA_BadPacketHeader, cWMA_BrokenFrame, cWMA_NoMoreFrames, cWMA_BadSamplingRate, cWMA_BadNumberOfChannels, cWMA_BadVersionNumber, cWMA_BadWeightingMode, cWMA_BadPacketization, cWMA_BadDRMType, cWMA_DRMFailed, cWMA_DRMUnsupported, cWMA_DemoExpired, cWMA_BadState, cWMA_Internal, /* really bad */ cWMA_NoMoreDataThisTime} tWMAFileStatus;#endif /* _WMAFILESTATUS_DEFINED *//* versions */#ifndef _WMAFILEVERSION_DEFINED#define _WMAFILEVERSION_DEFINEDtypedef enum tagWMAFileVersion{ cWMA_V1 = 1, cWMA_V2 = 2} tWMAFileVersion;#endif /* _WMAFILEVERSION_DEFINED *//* sample rates */#ifndef _WMAFILESAMPLERATE_DEFINED#define _WMAFILESAMPLERATE_DEFINEDtypedef enum tagWMAFileSampleRate{ cWMA_SR_48kHz, cWMA_SR_44_1kHz, cWMA_SR_32kHz, cWMA_SR_22_05kHz, cWMA_SR_16kHz, cWMA_SR_11_025kHz, cWMA_SR_08kHz} tWMAFileSampleRate;#endif /* _WMAFILESAMPLERATE_DEFINED *//* channels */#ifndef _WMAFILECHANNELS_DEFINED#define _WMAFILECHANNELS_DEFINEDtypedef enum tagWMAFileChannels{ cWMA_C_Mono = 1, cWMA_C_Stereo = 2} tWMAFileChannels;#endif /* _WMAFILECHANNELS_DEFINED *//* ........................................................................... * * Structures * ========== *//* header */#ifndef _WMAFILEHEADER_DEFINED#define _WMAFILEHEADER_DEFINEDtypedef PACKED struct tagWMAFileHeader{ tWMAFileVersion version; /* version of the codec */ tWMAFileSampleRate sample_rate; /* sampling rate */ tWMAFileChannels num_channels; /* number of audio channels */ tWMA_U32 duration; /* of the file in milliseconds */ tWMA_U32 packet_size; /* size of an ASF packet */ tWMA_U32 first_packet_offset; /* byte offset to the first ASF packet */ tWMA_U32 last_packet_offset; /* byte offset to the last ASF packet */ tWMA_U32 has_DRM; /* does it have DRM encryption? */ tWMA_U32 LicenseLength; /* License Length in the header */ tWMA_U32 bitrate; /* bit-rate of the WMA bitstream */ /* HongCho: what else? */} tWMAFileHeader;#endif /* _WMAFILEHEADER_DEFINED *//* content description */#ifndef _WMAFILECONTDESC_DEFINED#define _WMAFILECONTDESC_DEFINEDtypedef PACKED struct tagWMAFileContDesc{ /* *_len: as [in], they specify how large the corresponding * buffers below are. * as [out], they specify how large the returned * buffers actually are. */ tWMA_U16 title_len; tWMA_U16 author_len; tWMA_U16 copyright_len; tWMA_U16 description_len; /* rarely used */ tWMA_U16 rating_len; /* rarely used */ /* these are two-byte strings * for ASCII-type character set, to convert these * into a single-byte characters, simply skip * over every other bytes. */ unsigned char *pTitle; unsigned char *pAuthor; unsigned char *pCopyright; unsigned char *pDescription; unsigned char *pRating;} tWMAFileContDesc;#endif /* _WMAFILECONTDESC_DEFINED *//* license params */#ifndef _WMAFILELICPARAMS_DEFINED#define _WMAFILELICPARAMS_DEFINEDtypedef PACKED struct tagWMAFileLicParams{ unsigned char *pPMID; /* portable media id */ tWMA_U32 cbPMID; /* length of the pPMID buffer */} tWMAFileLicParams;#endif /* _WMAFILELICPARAMS_DEFINED */typedef void * tHWMAFileState;/* another internal state */#ifndef _WMAFILEHDRSTATE_DEFINED#define _WMAFILEHDRSTATE_DEFINEDtypedef PACKED struct tagWMAFileHdrState{ unsigned char internal[1228];// unsigned char internal[188];} tWMAFileHdrState;#endif /* _WMAFILEHDRSTATE_DEFINED */#ifdef _Embedded_x86#pragma pack ()#endif/* ........................................................................... * * Functions * ========= */#ifdef __cplusplusextern "C"{#endif /* __cplusplus *//* * WMAFileIsWMA * ============ * * Description * ----------- * Checks to see if the file is decodable. Uses WMAFileCBGetData(), * but the first argument to it is not really of type tHWMAFileState, * but tWMAFileIdState. * * To decode the file, the app should call WMAFileDecodeInit() * instead. * * This function was added in case the app wants to determine the * type of the file without fully allocating tHWMAFileState. * * Syntax * ------ * tWMAFileStatus WMAFileIsWMA(tWMAFileHdrState *state); * * where: * * state pointer to the smaller structure that contains * state of the checking function * * Return Value * ------------ * cWMA_NoErr yes, it's a WMA file * cWMA_BadArgument bad argument passed in * cWMA_BadAsfHeader bad ASF header * */tWMAFileStatus WMAFileIsWMA (tWMAFileHdrState *state);/* * WMAGetNumberOfMarkers * ============ * * Description * ----------- * Return the total number of Markers in the asf file * * Syntax * ------ * int WMAGetNumberOfMarkers(tWMAFileHdrState *state); * * where: * * state pointer to the smaller structure that contains * state of the checking function * * Return Value * ------------ * total number of Markers in the asf file * */int WMAGetNumberOfMarkers(tWMAFileHdrState *state); /* * WMAGetMarker * ============ * * Description * ----------- * WMAGetMarker(...) is designed to return the Marker specified by an index integer iIndex * If the total number of Markers returned by WMAGetNumberOfMarkers is total_num_of_markers, * all the Markers are indexed from 0 to total_num_of_markers - 1. * When a Marker structure MarkerEntry is allocated by the application * and the pointer to that Marker structure is passed in WMAGetMarker(...) with pEntry, * succesful calling of WMAGetMarker(...) will fill up the Marker structure *pEntry * with the Marker identified by the index iIndex. * * Syntax * ------ * tWMAFileStatus WMAGetMarker(tWMAFileHdrState *state, int iIndex, MarkerEntry *pEntry); * * where: * * state pointer to the smaller structure that contains * state of the checking function * pEntry pointer to the Marker structure MarkerEntryEx * allocated by the application * iIndex index to specify which Marker to return * * Return Value * ------------ * return cWMA_NoErr * if WMAGetMarker(...) succeed in returning the Marker specified by iIndex. * return cWMA_Failed * if WMAGetMarker(...) failed in returning the Marker specified by iIndex. */tWMAFileStatus WMAGetMarker(tWMAFileHdrState *state, int iIndex, MarkerEntry *pEntry); /* * WMAGetLicenseStore * ============ * * Description * ----------- * Get the marker list so the main program can seek the file freely. * * Syntax * ------ * BYTE * WMAGetLicenseStore(tWMAFileHdrState *pstate,tWMA_U32 *pLen) * * where: * * state pointer to the smaller structure that contains * state of the checking function * pLen Address of the poitner to store the size of license. * * Return Value * ------------ * Pointer of data chunck * */unsigned char * WMAGetLicenseStore(tWMAFileHdrState *pstate,tWMA_U32 *pLen);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -