///////////////////////////////////////////////////////////////////////////////////////// // // 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 // ///////////////////////////////////////////////////////////////////////////////////////// //// // wav.h - interface for wav functions in wav.c //// #ifndef __WAV_H__ #define __WAV_H__ #ifdef _WIN32 #define MULTITHREAD 1 #endif #include "winlocal.h" #include "wavfmt.h" #include "wavout.h" #include "wavin.h" #define WAV_VERSION 0x00000108 // values in WavInit // #define WAV_TELTHUNK 0x00004000 #define WAV_NOTSMTHUNK 0x00008000 #define WAV_VOXADPCM 0x00000001 // values in WavOpen // #define WAV_READ 0x00000000 #define WAV_WRITE 0x00000001 #define WAV_READWRITE 0x00000002 #define WAV_CREATE 0x00000004 #define WAV_NORIFF 0x00000008 #define WAV_MEMORY 0x00000010 #define WAV_RESOURCE 0x00000020 #define WAV_DENYNONE 0x00000040 #define WAV_DENYREAD 0x00000080 #define WAV_DENYWRITE 0x00000100 #define WAV_EXCLUSIVE 0x00000200 #define WAV_NOACM 0x00000400 #define WAV_DELETE 0x00000800 #define WAV_EXIST 0x00001000 #define WAV_GETTEMP 0x00002000 #define WAV_TELRFILE 0x00008000 #ifdef MULTITHREAD #define WAV_MULTITHREAD 0x00010000 #define WAV_SINGLETHREAD 0x00020000 #define WAV_COINITIALIZE 0x00040000 #endif // values in WavPlay // #define WAV_PLAYASYNC 0x00000000 #define WAV_PLAYSYNC 0x00001000 #define WAV_AUTOSTOP 0x00002000 #define WAV_NOAUTOSTOP 0x00004000 #define WAV_AUTOCLOSE 0x00008000 // values in WavRecord // #define WAV_RECORDASYNC 0x00000000 #define WAV_RECORDSYNC 0x00010000 // values in WavPlaySound // #define WAV_ASYNC 0x00000000 #define WAV_SYNC 0x00100000 #define WAV_FILENAME 0x00200000 #define WAV_NODEFAULT 0x00400000 #define WAV_LOOP 0x00800000 #define WAV_NOSTOP 0x01000000 #define WAV_OPENRETRY 0x10000000 // control flags for WavSetSpeed and WavSupportsSpeed // #define WAVSPEED_NOPLAYBACKRATE 0x00000001 #define WAVSPEED_NOFORMATADJUST 0x00000002 #define WAVSPEED_NOTSM 0x00000004 #define WAVSPEED_NOACM 0x00000400 // return values from WavGetState // #define WAV_STOPPED 0x0001 #define WAV_PLAYING 0x0002 #define WAV_RECORDING 0x0004 #define WAV_STOPPING 0x0008 // values in WavGetFormat and WavSetFormat // #define WAV_FORMATFILE 0x0001 #define WAV_FORMATPLAY 0x0002 #define WAV_FORMATRECORD 0x0004 #define WAV_FORMATALL (WAV_FORMATFILE | WAV_FORMATPLAY | WAV_FORMATRECORD) // values in WavSetVolume and WavSupportsVolume // #define WAVVOLUME_MIXER 0x0001 #ifdef TELTHUNK // control flags for WavOpenEx // #define WOX_LOCAL 0x00000001 #define WOX_REMOTE 0x00000002 #define WOX_WAVFMT 0x00000010 #define WOX_VOXFMT 0x00000020 #define WOX_WAVDEV 0x00000100 #define WOX_TELDEV 0x00000200 #endif // handle returned from WavInit // DECLARE_HANDLE32(HWAVINIT); // handle returned from WavOpen // (NOT the same as Windows HWAVE) // DECLARE_HANDLE32(HWAV); // prototype for in WavCopy // typedef BOOL (CALLBACK* USERABORTPROC)(DWORD dwUser, int nPctComplete); // prototype for in WavPlay // typedef BOOL (CALLBACK* PLAYSTOPPEDPROC)(HWAV hWav, HANDLE hUser, DWORD dwReserved); // prototype for in WavRecord // typedef BOOL (CALLBACK* RECORDSTOPPEDPROC)(HWAV hWav, DWORD dwUser, DWORD dwReserved); #ifdef __cplusplus extern "C" { #endif // WavInit - initialize wav engine // (i) must be WAV_VERSION // (i) instance handle of calling module // (i) control flags #ifdef TELTHUNK // WAV_TELTHUNK initialize telephone thunking layer #endif // WAV_NOACM do not use audio compression manager // WAV_VOXADPCM load acm driver for Dialogic OKI ADPCM // return handle (NULL if error) // HWAVINIT WINAPI WavInit(DWORD dwVersion, HINSTANCE hInst, DWORD dwFlags); // WavTerm - shut down wav engine // (i) handle returned from WavInit // return 0 if success // int WINAPI WavTerm(HWAVINIT hWavInit); // WavOpen - open or create wav file // (i) must be WAV_VERSION // (i) instance handle of calling module // (i) name of file to open or create // (i) wave format // NULL use format from header or default // (i) address of i/o procedure to use // NULL use default i/o procedure // (i) data to pass to i/o procedure during open // NULL no data to pass // (i) control flags // WAV_READ open file for reading (default) // WAV_WRITE open file for writing // WAV_READWRITE open file for reading and writing // WAV_DENYNONE allow other programs read and write access // WAV_DENYREAD prevent other programs from read access // WAV_DENYWRITE prevent other programs from write access // WAV_EXCLUSIVE prevent other programs from read or write // WAV_CREATE create new file or truncate existing file // WAV_NORIFF file has no RIFF/WAV header // WAV_MEMORY points to memory block // WAV_RESOURCE points to wave resource // WAV_NOACM do not use audio compression manager // WAV_DELETE delete specified file, return TRUE if success // WAV_EXIST return TRUE if specified file exists // WAV_GETTEMP fill lpszFileName with temp name, return TRUE // WAV_TELRFILE telephone will play audio from file on server #ifdef MULTITHREAD // WAV_MULTITHREAD support multiple threads (default) // WAV_SINGLETHREAD do not support multiple threads // WAV_COINITIALIZE call CoInitialize in all secondary threads #endif // return handle (NULL if error) // // NOTE: if WAV_CREATE or WAV_NORIFF are used in , then the // parameter must be specified. If is NULL, the // current default format is assumed. // WavSetFormat() can be used to set or override the defaults. // // NOTE: if WAV_RESOURCE is specified in , then // must point to a WAVE resource in the module specified by . // If the first character of the string is a pound sign (#), the remaining // characters represent a decimal number that specifies the resource id. // // NOTE: if WAV_MEMORY is specified in , then // must be a pointer to a memory block obtained by calling MemAlloc(). // // NOTE: if is not NULL, this i/o procedure will be called // for opening, closing, reading, writing, and seeking the wav file. // If is not NULL, this array of three (3) DWORDs will be // passed to the i/o procedure when the wav file is opened. // See the Windows mmioOpen() and mmioInstallIOProc() function for details // on these parameters. Also, the WAV_MEMORY and WAV_RESOURCE flags may // only be used when is NULL. // HWAV WINAPI WavOpen(DWORD dwVersion, HINSTANCE hInst, LPCTSTR lpszFileName, LPWAVEFORMATEX lpwfx, LPMMIOPROC lpIOProc, DWORD FAR *lpadwInfo, DWORD dwFlags); // WavClose - close wav file // (i) handle returned from WavOpen // return 0 if success // int WINAPI WavClose(HWAV hWav); // WavPlayEx - play data from wav file // (i) handle returned from WavOpen // (i) wav output device id // -1 use any suitable output device // (i) function to call when play is stopped // NULL do not notify // (i) param to pass to lpfnPlayStopped // (i) reserved; must be zero // (i) control flags // WAV_PLAYASYNC return when playback starts (default) // WAV_PLAYSYNC return after playback completes // WAV_NOSTOP if device already playing, don't stop it // WAV_AUTOSTOP stop playback when eof reached (default) // WAV_NOAUTOSTOP continue playback until WavStop called // WAV_AUTOCLOSE close wav file after playback stops // WAV_OPENRETRY if output device busy, retry for up to 2 sec // return 0 if success // // NOTE: data from the wav file is sent to the output device in chunks. // Chunks are submitted to an output device queue, so that when one // chunk is finished playing, another is ready to start playing. By // default, each chunk is large enough to hold approximately 666 ms // of sound, and 3 chunks are maintained in the output device queue. // WavSetChunks() can be used to override the defaults. // // NOTE: if WAV_NOSTOP is specified in , and the device specified // by is already in use, this function returns without playing. // Unless this flag is specified, the specified device will be stopped // so that the new sound can be played. // // NOTE: if WAV_AUTOSTOP is specified in , WavStop() will be // called automatically when end of file is reached. This is the // default behavior, but can be overridden by using the WAV_NOAUTOSTOP // flag. WAV_NOAUTOSTOP is useful if you are playing a file that // is growing dynamically as another program writes to it. If this is // the case, also use the WAV_DENYNONE flag when calling WavOpen(). // // NOTE: if WAV_AUTOCLOSE is specified in , WavClose() will // be called automatically when playback completes. This will happen // when WavStop() is called explicitly, or when WavPlay() reaches end // of file and WAV_NOAUTOSTOP was not specified. WAV_AUTOCLOSE is useful // when used with WAV_PLAYASYNC, since cleanup occurs automatically. // The handle is thereafter invalid, and should not be used again. // int WINAPI WavPlay(HWAV hWav, int idDev, DWORD dwFlags); int DLLEXPORT WINAPI WavPlayEx(HWAV hWav, int idDev, PLAYSTOPPEDPROC lpfnPlayStopped, HANDLE hUserPlayStopped, DWORD dwReserved, DWORD dwFlags); // WavRecordEx - record data to wav file // (i) handle returned from WavOpen // (i) wav input device id // -1 use any suitable input device // (i) function to call when record is stopped // NULL do not notify // (i) param to pass to lpfnRecordStopped // (i) stop recording if file reaches this size // 0 no maximum size // (i) control flags // WAV_RECORDASYNC return when recording starts (default) // WAV_RECORDSYNC return after recording completes // WAV_NOSTOP if device already recording, don't stop it // WAV_OPENRETRY if input device busy, retry for up to 2 sec // return 0 if success // // NOTE: data from the input device is written to the wav file in chunks. // Chunks are submitted to an input device queue, so that when one // chunk is finished recording, another is ready to start recording. // By default, each chunk is large enough to hold approximately 666 ms // of sound, and 3 chunks are maintained in the input device queue. // WavSetChunks() can be used to override the defaults. // // NOTE: if WAV_NOSTOP is specified in , and the device specified // by is already in use, this function returns without recording. // Unless this flag is specified, the specified device will be stopped // so that the new sound can be recorded. // int WINAPI WavRecord(HWAV hWav, int idDev, DWORD dwFlags); int DLLEXPORT WINAPI WavRecordEx(HWAV hWav, int idDev, RECORDSTOPPEDPROC lpfnRecordStopped, DWORD dwUserRecordStopped, long msMaxSize, DWORD dwFlags); // WavStop - stop playing and/or recording // (i) handle returned from WavOpen // return 0 if success // int WINAPI WavStop(HWAV hWav); // WavRead - read data from wav file // (i) handle returned from WavOpen // (o) buffer to contain bytes read // (i) size of buffer in bytes // return bytes read (-1 if error) // // NOTE : Even if the read operation does not reach the end of file, // the number of bytes returned could be less than if data // decompression is performed by the wav file's I/O procedure. See the // parameter in WavOpen. It is safest to keep calling // WavRead() until 0 bytes are read. // long DLLEXPORT WINAPI WavRead(HWAV hWav, void _huge *hpBuf, long sizBuf); // WavWrite - write data to wav file // (i) handle returned from WavOpen // (i) buffer containing bytes to write // (i) size of buffer in bytes // return bytes written (-1 if error) // // NOTE : Even if the write operation successfully completes, // the number of bytes returned could be less than if data // compression is performed by the wav file's I/O procedure. See the // parameter in WavOpen. It is safest to assume no error // in WavWrite() occurred if the return value is greater than 0. // long DLLEXPORT WINAPI WavWrite(HWAV hWav, void _huge *hpBuf, long sizBuf); // WavSeek - seek within wav file data // (i) handle returned from WavOpen // (i) bytes to move pointer // (i) position to move from // 0 move pointer relative to start of data chunk // 1 move pointer relative to current position // 2 move pointer relative to end of data chunk // return new file position (-1 if error) // long DLLEXPORT WINAPI WavSeek(HWAV hWav, long lOffset, int nOrigin); // WavGetState - return current wav state // (i) handle returned from WavOpen // return WAV_STOPPED, WAV_PLAYING, WAV_RECORDING, or 0 if error // WORD DLLEXPORT WINAPI WavGetState(HWAV hWav); // WavGetLength - get current wav data length in milleseconds // (i) handle returned from WavOpen // return milleseconds if success, otherwise -1 // long DLLEXPORT WINAPI WavGetLength(HWAV hWav); // WavSetLength - set current wav data length in milleseconds // (i) handle returned from WavOpen // (i) length in milleseconds // return new length in milleseconds if success, otherwise -1 // // NOTE: afterwards, the current wav data position is set to either // the previous wav data position or , whichever is smaller. // long DLLEXPORT WINAPI WavSetLength(HWAV hWav, long msLength); // WavGetPosition - get current wav data position in milleseconds // (i) handle returned from WavOpen // return milleseconds if success, otherwise -1 // long DLLEXPORT WINAPI WavGetPosition(HWAV hWav); // WavSetPosition - set current wav data position in milleseconds // (i) handle returned from WavOpen // (i) position in milleseconds // return new position in milleseconds if success, otherwise -1 // long DLLEXPORT WINAPI WavSetPosition(HWAV hWav, long msPosition); // WavGetFormat - get wav format // (i) handle returned from WavOpen // (i) control flags // WAV_FORMATFILE get format of data in file // WAV_FORMATPLAY get format of output device // WAV_FORMATRECORD get format of input device // return pointer to specified format, NULL if error // // NOTE: the format structure returned is dynamically allocated. // Use WavFormatFree() to free the buffer. // LPWAVEFORMATEX DLLEXPORT WINAPI WavGetFormat(HWAV hWav, DWORD dwFlags); // WavSetFormat - set wav format // (i) handle returned from WavOpen // (i) wav format // (i) control flags // WAV_FORMATFILE set format of data in file // WAV_FORMATPLAY set format of output device // WAV_FORMATRECORD set format of input device // WAV_FORMATALL set all formats // return 0 if success // int DLLEXPORT WINAPI WavSetFormat(HWAV hWav, LPWAVEFORMATEX lpwfx, DWORD dwFlags); // WavChooseFormat - choose and set audio format from dialog box // (i) handle returned from WavOpen // (i) owner of dialog box // NULL no owner // (i) title of the dialog box // NULL use default title ("Sound Selection") // (i) control flags // WAV_FORMATFILE set format of data in file // WAV_FORMATPLAY set format of output device // WAV_FORMATRECORD set format of input device // WAV_FORMATALL set all formats // return 0 if success // int DLLEXPORT WINAPI WavChooseFormat(HWAV hWav, HWND hwndOwner, LPCTSTR lpszTitle, DWORD dwFlags); // WavGetVolume - get current volume level // (i) handle returned from WavOpen // (i) wav output device id // -1 use any suitable output device // (i) reserved; must be zero // return volume level (0 minimum through 100 maximum, -1 if error) // int DLLEXPORT WINAPI WavGetVolume(HWAV hWav, int idDev, DWORD dwFlags); // WavSetVolume - set current volume level // (i) handle returned from WavOpen // (i) wav output device id // -1 use any suitable output device // (i) volume level // 0 minimum volume // 100 maximum volume // (i) control flags // WAVVOLUME_MIXER set volume through mixer device // return 0 if success // int DLLEXPORT WINAPI WavSetVolume(HWAV hWav, int idDev, int nLevel, DWORD dwFlags); // WavSupportsVolume - check if audio can be played at specified volume // (i) handle returned from WavOpen // (i) wav output device id // -1 any suitable output device // (i) volume level // 0 minimum volume // 100 maximum volume // (i) control flags // WAVVOLUME_MIXER check volume support through mixer device // return TRUE if supported // BOOL DLLEXPORT WINAPI WavSupportsVolume(HWAV hWav, int idDev, int nLevel, DWORD dwFlags); // WavGetSpeed - get current speed level // (i) handle returned from WavOpen // (i) wav output device id // -1 use any suitable output device // (i) reserved; must be zero // return speed level (100 is normal, 50 is half, 200 is double, -1 if error) // int DLLEXPORT WINAPI WavGetSpeed(HWAV hWav, int idDev, DWORD dwFlags); // WavSetSpeed - set current speed level // (i) handle returned from WavOpen // (i) wav output device id // -1 use any suitable output device // (i) speed level // 50 half speed // 100 normal speed // 200 double speed, etc. // (i) control flags #ifdef AVTSM // WAVSPEED_NOTSM do not use time scale modification engine #endif // WAVSPEED_NOPLAYBACKRATE do not use device driver playback rate // WAVSPEED_NOFORMATADJUST do not use adjusted format to open device // WAVSPEED_NOACM do not use audio compression manager // return 0 if success // // NOTE: In order to accomodate the specified speed change, it is _possible_ // that this function will in turn call WavSetFormat(hWav, ..., WAV_FORMATPLAY) // to change the playback format of the specified file. You can prevent this // side-effect by specifying the WAVSPEED_NOACM flag, but this reduces the // likelihood that WavSetSpeed will succeed. // int DLLEXPORT WINAPI WavSetSpeed(HWAV hWav, int idDev, int nLevel, DWORD dwFlags); // WavSupportsSpeed - check if audio can be played at specified speed // (i) handle returned from WavOpen // (i) wav output device id // -1 any suitable output device // (i) speed level // 50 half speed // 100 normal speed // 200 double speed, etc. // (i) control flags #ifdef AVTSM // WAVSPEED_NOTSM do not use time scale modification engine #endif // WAVSPEED_NOPLAYBACKRATE do not use device driver playback rate // WAVSPEED_NOFORMATADJUST do not use adjusted format to open device // WAVSPEED_NOACM do not use audio compression manager // return TRUE if supported // BOOL DLLEXPORT WINAPI WavSupportsSpeed(HWAV hWav, int idDev, int nLevel, DWORD dwFlags); // WavGetChunks - get chunk count and size // (i) handle returned from WavOpen // NULL get default chunk count and size // (o) buffer to hold chunk count // NULL do not get chunk count // (o) buffer to hold chunk size // NULL do not get chunk size // (i) TRUE for playback, FALSE for recording // return 0 if success // int DLLEXPORT WINAPI WavGetChunks(HWAV hWav, int FAR *lpcChunks, long FAR *lpmsChunkSize, BOOL fWavOut); // WavSetChunks - set chunk count and size // (i) handle returned from WavOpen // NULL set default chunk count and size // (i) number of chunks in device queue // -1 do not set chunk count // (i) chunk size in milleseconds // -1 do not set chunk size // (i) TRUE for playback, FALSE for recording // return 0 if success // int DLLEXPORT WINAPI WavSetChunks(HWAV hWav, int cChunks, long msChunkSize, BOOL fWavOut); // WavCalcChunkSize - calculate chunk size in bytes // (i) wav format // (i) chunk size in milleseconds // -1 default chunk size // (i) TRUE for playback, FALSE for recording // return chunk size in bytes (-1 if success) // long DLLEXPORT WINAPI WavCalcChunkSize(LPWAVEFORMATEX lpwfx, long msChunkSize, BOOL fWavOut); // WavCopy - copy data from one open wav file to another // (i) source handle returned from WavOpen // (i) destination handle returned from WavOpen // (o) pointer to copy buffer // NULL allocate buffer internally // (i) size of copy buffer // -1 default buffer size (16K) // (i) function that returns TRUE if user aborts // NULL don't check for user abort // (i) parameter passed to // (i) control flags // WAV_NOACM do not use audio compression manager // return 0 if success (-1 if error, +1 if user abort) // int DLLEXPORT WINAPI WavCopy(HWAV hWavSrc, HWAV hWavDst, void _huge *hpBuf, long sizBuf, USERABORTPROC lpfnUserAbort, DWORD dwUser, DWORD dwFlags); #ifdef AVTSM // WavReadFormatSpeed - read data from wav file, then format it for speed // (i) handle returned from WavOpen // (o) buffer to contain bytes read // (i) size of buffer in bytes // return bytes formatted for speed in (-1 if error) // // NOTE: this function reads a block of data, and then converts it // from the file format to the speed format, unless those formats // are identical. // long DLLEXPORT WINAPI WavReadFormatSpeed(HWAV hWav, void _huge *hpBufSpeed, long sizBufSpeed); #endif // WavReadFormatPlay - read data from wav file, then format it for playback // (i) handle returned from WavOpen // (o) buffer to contain bytes read // (i) size of buffer in bytes // return bytes formatted for playback in (-1 if error) // // NOTE: this function reads a block of data, and then converts it // from the file format to the playback format, unless those formats // are identical. // long DLLEXPORT WINAPI WavReadFormatPlay(HWAV hWav, void _huge *hpBufPlay, long sizBufPlay); // WavWriteFormatRecord - write data to file after formatting it for file // (i) handle returned from WavOpen // (i) buffer containing bytes in record format // (i) size of buffer in bytes // return bytes written (-1 if error) // // NOTE: this function converts a block of data from the record // format to the file format (unless those formats are identical), // and then writes the data to disk. // long DLLEXPORT WINAPI WavWriteFormatRecord(HWAV hWav, void _huge *hpBufRecord, long sizBufRecord); // WavGetOutputDevice - get handle to open wav output device // (i) handle returned from WavOpen // return handle to wav output device (NULL if device not open or error) // // NOTE: this function is useful only during playback (after calling // WavPlay() and before calling WavStop()). The returned device handle // can then be used when calling the WavOut functions in wavout.h // HWAVOUT DLLEXPORT WINAPI WavGetOutputDevice(HWAV hWav); // WavGetInputDevice - get handle to open wav input device // (i) handle returned from WavOpen // return handle to wav input device (NULL if device not open or error) // // NOTE: this function is useful only during recording (after calling // WavRecord() and before calling WavStop()). The returned device handle // can then be used when calling the WavIn functions in wavin.h // HWAVIN DLLEXPORT WINAPI WavGetInputDevice(HWAV hWav); // WavPlaySound - play wav file // (i) must be WAV_VERSION // (i) instance handle of calling module // (i) wav output device id // -1 use any suitable output device // (i) name of file to play // NULL stop playing current sound, if any // (i) wave format // NULL use format from header or default // (i) address of i/o procedure to use // NULL use default i/o procedure // (i) data to pass to i/o procedure during open // NULL no data to pass // (i) control flags // WAV_ASYNC return when playback starts (default) // WAV_SYNC return after playback completes // WAV_FILENAME points to a filename // WAV_RESOURCE points to a resource // WAV_MEMORY points to memory block // WAV_NODEFAULT if sound not found, do not play default // WAV_LOOP loop sound until WavPlaySound called again // WAV_NOSTOP if device already playing, don't stop it // WAV_NORIFF file has no RIFF/WAV header // WAV_NOACM do not use audio compression manager // WAV_OPENRETRY if output device busy, retry for up to 2 sec #ifdef MULTITHREAD // WAV_MULTITHREAD support multiple threads (default) // WAV_SINGLETHREAD do not support multiple threads // WAV_COINITIALIZE call CoInitialize in all secondary threads #endif // return 0 if success // // NOTE: if WAV_NORIFF is specified in , then the // parameter must be specified. If is NULL, the // current default format is assumed. // WavSetFormat() can be used to set or override the defaults. // // NOTE: if WAV_FILENAME is specified in , then // must point to a file name. // // NOTE: if WAV_RESOURCE is specified in , then // must point to a WAVE resource in the module specified by . // If the first character of the string is a pound sign (#), the remaining // characters represent a decimal number that specifies the resource id. // // NOTE: if WAV_MEMORY is specified in , then // must be a pointer to a memory block containing a wav file image. // The pointer must be obtained by calling MemAlloc(). // // NOTE: if neither WAV_FILENAME, WAV_RESOURCE, or WAV_MEMORY is specified // in , the [sounds] section of win.ini or the registry is // searched for an entry matching . If no matching entry // is found, is assumed to be a file name. // // NOTE: if WAV_NODEFAULT is specified in , no default sound // will be played. Unless this flag is specified, the default system // event sound entry will be played if the sound specified in // is not found. // // NOTE: if WAV_LOOP is specified in , the sound specified in // will be played repeatedly, until WavPlaySound() is // called again. The WAV_ASYNC flag must be specified when using this flag. // // NOTE: if WAV_NOSTOP is specified in , and the device specified // by is already in use, this function returns without playing. // Unless this flag is specified, the specified device will be stopped // so that the new sound can be played. // // NOTE: if is not NULL, this i/o procedure will be called // for opening, closing, reading, writing, and seeking the wav file. // If is not NULL, this array of three (3) DWORDs will be // passed to the i/o procedure when the wav file is opened. // See the Windows mmioOpen() and mmioInstallIOProc() function for details // on these parameters. Also, the WAV_MEMORY and WAV_RESOURCE flags may // only be used when is NULL. // int DLLEXPORT WINAPI WavPlaySound(DWORD dwVersion, HINSTANCE hInst, int idDev, LPCTSTR lpszFileName, LPWAVEFORMATEX lpwfx, LPMMIOPROC lpIOProc, DWORD FAR *lpadwInfo, DWORD dwFlags); // WavSendMessage - send a user-defined message to the i/o procedure // (i) handle returned from WavOpen // (i) user-defined message id // (i) parameter for the message // (i) parameter for the message // return value from the i/o procedure (0 if error or unrecognized message) // LRESULT DLLEXPORT WINAPI WavSendMessage(HWAV hWav, UINT wMsg, LPARAM lParam1, LPARAM lParam2); #ifdef TELTHUNK // WavOpenEx - open an audio file, extra special version // (i) must be WAV_VERSION // (i) instance handle of calling module // (i) name of file to open // (i) reserved; must be zero // (i) control flags to pass to WavOpen // (i) control flags // WOX_LOCAL file is on local client // WOX_REMOTE file is on remote server // WOX_WAVFMT file is in Microsoft RIFF/WAV format // WOX_VOXFMT file is in Dialogic OKI ADPCM (vox) format // WOX_WAVDEV file will be played on wav output device // WOX_TELDEV file will be played on telephone device // return handle (NULL if error) // HWAV DLLEXPORT WINAPI WavOpenEx(DWORD dwVersion, HINSTANCE hInst, LPTSTR lpszFileName, DWORD dwReserved, DWORD dwFlagsOpen, DWORD dwFlagsEx); #endif #ifdef __cplusplus } #endif #endif // __WAV_H__