///////////////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1998 Active Voice Corporation. All Rights Reserved. // // Active Agent(r) and Unified Communications(tm) are trademarks of Active Voice Corporation. // // Other brand and product names used herein are trademarks of their respective owners. // // The entire program and user interface including the structure, sequence, selection, // and arrangement of the dialog, the exclusively "yes" and "no" choices represented // by "1" and "2," and each dialog message are protected by copyrights registered in // the United States and by international treaties. // // Protected by one or more of the following United States patents: 5,070,526, 5,488,650, // 5,434,906, 5,581,604, 5,533,102, 5,568,540, 5,625,676, 5,651,054. // // Active Voice Corporation // Seattle, Washington // USA // ///////////////////////////////////////////////////////////////////////////////////////// //// // acm.h - interface for acm functions in acm.c //// #ifndef __ACM_H__ #define __ACM_H__ #include "winlocal.h" #include "wavfmt.h" #define ACM_VERSION 0x00000106 // values in AcmInit // #define ACM_NOACM 0x00000001 // values in AcmFormatChoose // #define ACM_FORMATPLAY 0x00001000 #define ACM_FORMATRECORD 0x00002000 // values in AcmConvertInit // #define ACM_NONREALTIME 0x00000010 #define ACM_QUERY 0x00000020 // handle to acm engine returned from AcmInit // DECLARE_HANDLE32(HACM); // handle to acm driver returned from AcmDriverLoad // DECLARE_HANDLE32(HACMDRV); #ifdef __cplusplus extern "C" { #endif // AcmInit - initialize audio compression manager engine // (i) must be ACM_VERSION // (i) instance handle of calling module // (i) control flags #ifdef AVPCM // ACM_NOACM use internal pcm engine rather than acm #endif // return handle (NULL if error) // HACM DLLEXPORT WINAPI AcmInit(DWORD dwVersion, HINSTANCE hInst, DWORD dwFlags); // AcmTerm - shut down audio compression manager engine // (i) handle returned from AcmInit // return 0 if success // int DLLEXPORT WINAPI AcmTerm(HACM hAcm); // AcmFormatGetSizeMax - get size of largest acm WAVEFORMATEX struct // (i) handle returned from AcmInit // // return size of largest format struct, -1 if error // int DLLEXPORT WINAPI AcmFormatGetSizeMax(HACM hAcm); // AcmFormatChoose - choose audio format from dialog box // (i) handle returned from AcmInit // (i) owner of dialog box // NULL no owner // (i) title of the dialog box // NULL use default title ("Sound Selection") // (i) initialize dialog with this format // NULL no initial format // (i) control flags // ACM_FORMATPLAY restrict choices to playback formats // ACM_FORMATRECORD restrict choices to recording formats // return pointer to chosen format, NULL if error or none chosen // // NOTE: the format structure returned is dynamically allocated. // Use WavFormatFree() to free the buffer. // #define AcmFormatChoose(hAcm, hwndOwner, lpszTitle, lpwfx, dwFlags) \ AcmFormatChooseEx(hAcm, hwndOwner, lpszTitle, lpwfx, dwFlags) LPWAVEFORMATEX DLLEXPORT WINAPI AcmFormatChooseEx(HACM hAcm, HWND hwndOwner, LPCTSTR lpszTitle, LPWAVEFORMATEX lpwfx, DWORD dwFlags); // AcmFormatSuggest - suggest a new format // (i) handle returned from AcmInit // (i) source format // (i) suggested format must match this format tag // -1 suggestion need not match // (i) suggested format must match this sample rate // -1 suggestion need not match // (i) suggested format must match this sample size // -1 suggestion need not match // (i) suggested format must match this channels // -1 suggestion need not match // (i) control flags // 0 reserved; must be zero // return pointer to suggested format, NULL if error // // NOTE: the format structure returned is dynamically allocated. // Use WavFormatFree() to free the buffer. // #define AcmFormatSuggest(hAcm, lpwfxSrc, nFormatTag, nSamplesPerSec, \ nBitsPerSample, nChannels, dwFlags) \ AcmFormatSuggestEx(hAcm, lpwfxSrc, nFormatTag, nSamplesPerSec, \ nBitsPerSample, nChannels, dwFlags) LPWAVEFORMATEX DLLEXPORT WINAPI AcmFormatSuggestEx(HACM hAcm, LPWAVEFORMATEX lpwfxSrc, long nFormatTag, long nSamplesPerSec, int nBitsPerSample, int nChannels, DWORD dwFlags); // AcmFormatGetText - get text describing the specified format // (i) handle returned from AcmInit // (i) format // (o) buffer to hold text // (i) size of buffer, in characters // (i) control flags // 0 reserved; must be zero // return 0 if success // int DLLEXPORT WINAPI AcmFormatGetText(HACM hAcm, LPWAVEFORMATEX lpwfx, LPTSTR lpszText, int sizText, DWORD dwFlags); // AcmConvertInit - initialize acm conversion engine // (i) handle returned from AcmInit // (i) pointer to source WAVEFORMATEX struct // (i) pointer to destination WAVEFORMATEX struct // (i) pointer to WAVEFILTER struct // NULL reserved; must be NULL // (i) control flags // ACM_NONREALTIME realtime conversion conversion not required // ACM_QUERY return 0 if conversion would be supported // return 0 if success // int DLLEXPORT WINAPI AcmConvertInit(HACM hAcm, LPWAVEFORMATEX lpwfxSrc, LPWAVEFORMATEX lpwfxDst, LPWAVEFILTER lpwfltr, DWORD dwFlags); // AcmConvertTerm - shut down acm conversion engine // (i) handle returned from AcmInit // return 0 if success // int DLLEXPORT WINAPI AcmConvertTerm(HACM hAcm); // AcmConvertGetSizeSrc - calculate source buffer size // (i) handle returned from AcmInit // (i) size of destination buffer in bytes // return source buffer size, -1 if error // long DLLEXPORT WINAPI AcmConvertGetSizeSrc(HACM hAcm, long sizBufDst); // AcmConvertGetSizeDst - calculate destination buffer size // (i) handle returned from AcmInit // (i) size of source buffer in bytes // return destination buffer size, -1 if error // long DLLEXPORT WINAPI AcmConvertGetSizeDst(HACM hAcm, long sizBufSrc); // AcmConvert - convert wav data from one format to another // (i) handle returned from AcmInit // (i) buffer containing bytes to reformat // (i) size of buffer in bytes // (o) buffer to contain new format // (i) size of buffer in bytes // (i) control flags // 0 reserved; must be zero // return count of bytes in destination buffer (-1 if error) // // NOTE: the destination buffer must be large enough to hold the result // long DLLEXPORT WINAPI AcmConvert(HACM hAcm, void _huge *hpBufSrc, long sizBufSrc, void _huge *hpBufDst, long sizBufDst, DWORD dwFlags); // AcmDriverLoad - load an acm driver for use by this process // (i) handle returned from AcmInit // (i) manufacturer id // (i) product id // (i) name of driver module // (i) name of driver proc function // (i) control flags // 0 reserved; must be zero // return handle (NULL if error) // HACMDRV DLLEXPORT WINAPI AcmDriverLoad(HACM hAcm, WORD wMid, WORD wPid, LPTSTR lpszDriver, LPSTR lpszDriverProc, DWORD dwFlags); // AcmDriverUnload - unload an acm driver // (i) handle returned from AcmInit // (i) handle returned from AcmDriverLoad // return 0 if success // int DLLEXPORT WINAPI AcmDriverUnload(HACM hAcm, HACMDRV hAcmDrv); #ifdef __cplusplus } #endif #endif // __ACM_H__