wasapi: code cleanup, removed compiler warnings

This commit is contained in:
dmitrykos 2016-08-08 21:09:15 +03:00
commit 26c0dc4458
2 changed files with 68 additions and 55 deletions

View file

@ -130,7 +130,6 @@
#include <oleidl.h> #include <oleidl.h>
#include <objidl.h> #include <objidl.h>
#else #else
#ifndef WIN32_WINRT
typedef struct _BYTE_BLOB typedef struct _BYTE_BLOB
{ {
unsigned long clSize; unsigned long clSize;
@ -139,7 +138,6 @@
typedef /* [unique] */ __RPC_unique_pointer BYTE_BLOB *UP_BYTE_BLOB; typedef /* [unique] */ __RPC_unique_pointer BYTE_BLOB *UP_BYTE_BLOB;
typedef LONGLONG REFERENCE_TIME; typedef LONGLONG REFERENCE_TIME;
#define NONAMELESSUNION #define NONAMELESSUNION
#endif
#endif #endif
#ifndef WAVE_FORMAT_IEEE_FLOAT #ifndef WAVE_FORMAT_IEEE_FLOAT
@ -170,6 +168,8 @@
// Missing declarations for WinRT // Missing declarations for WinRT
#ifdef WIN32_WINRT #ifdef WIN32_WINRT
#define DEVICE_STATE_ACTIVE 0x00000001
typedef enum _EDataFlow typedef enum _EDataFlow
{ {
eRender = 0, eRender = 0,
@ -405,9 +405,6 @@ typedef struct PaWasapiDeviceInfo
REFERENCE_TIME DefaultDevicePeriod; REFERENCE_TIME DefaultDevicePeriod;
REFERENCE_TIME MinimumDevicePeriod; REFERENCE_TIME MinimumDevicePeriod;
// from GetMixFormat
// WAVEFORMATEX *MixFormat;//needs to be CoTaskMemFree'd after use!
// Default format (setup through Control Panel by user) // Default format (setup through Control Panel by user)
WAVEFORMATEXTENSIBLE DefaultFormat; WAVEFORMATEXTENSIBLE DefaultFormat;
@ -815,6 +812,7 @@ static UINT32 AlignFramesPerBuffer(UINT32 nFrames, UINT32 nSamplesPerSec, UINT32
long frame_bytes = nFrames * nBlockAlign; long frame_bytes = nFrames * nBlockAlign;
long packets; long packets;
(void)nSamplesPerSec;
// align to packet size // align to packet size
frame_bytes = pAlignFunc(frame_bytes, HDA_PACKET_SIZE); // use ALIGN_FWD if bigger but safer period is more desired frame_bytes = pAlignFunc(frame_bytes, HDA_PACKET_SIZE); // use ALIGN_FWD if bigger but safer period is more desired
@ -1236,7 +1234,7 @@ static MixMonoToStereoF _GetMonoToStereoMixer(PaSampleFormat format, EMixerDir d
// ------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------
#ifdef WIN32_WINRT #ifdef WIN32_WINRT
typedef struct _CActivateAudioInterfaceCompletionHandler typedef struct PaActivateAudioInterfaceCompletionHandler
{ {
IActivateAudioInterfaceCompletionHandler parent; IActivateAudioInterfaceCompletionHandler parent;
ULONG refs; ULONG refs;
@ -1248,15 +1246,15 @@ typedef struct _CActivateAudioInterfaceCompletionHandler
} }
out; out;
} }
CActivateAudioInterfaceCompletionHandler; PaActivateAudioInterfaceCompletionHandler;
static HRESULT ( STDMETHODCALLTYPE CActivateAudioInterfaceCompletionHandler_QueryInterface )( static HRESULT ( STDMETHODCALLTYPE PaActivateAudioInterfaceCompletionHandler_QueryInterface )(
IActivateAudioInterfaceCompletionHandler * This, IActivateAudioInterfaceCompletionHandler * This,
/* [in] */ REFIID riid, /* [in] */ REFIID riid,
/* [annotation][iid_is][out] */ /* [annotation][iid_is][out] */
_COM_Outptr_ void **ppvObject) _COM_Outptr_ void **ppvObject)
{ {
CActivateAudioInterfaceCompletionHandler *handler = (CActivateAudioInterfaceCompletionHandler *)This; PaActivateAudioInterfaceCompletionHandler *handler = (PaActivateAudioInterfaceCompletionHandler *)This;
// From MSDN: // From MSDN:
// "The IAgileObject interface is a marker interface that indicates that an object // "The IAgileObject interface is a marker interface that indicates that an object
@ -1271,17 +1269,17 @@ static HRESULT ( STDMETHODCALLTYPE CActivateAudioInterfaceCompletionHandler_Quer
return S_FALSE; return S_FALSE;
} }
static ULONG ( STDMETHODCALLTYPE CActivateAudioInterfaceCompletionHandler_AddRef )( static ULONG ( STDMETHODCALLTYPE PaActivateAudioInterfaceCompletionHandler_AddRef )(
IActivateAudioInterfaceCompletionHandler * This) IActivateAudioInterfaceCompletionHandler * This)
{ {
CActivateAudioInterfaceCompletionHandler *handler = (CActivateAudioInterfaceCompletionHandler *)This; PaActivateAudioInterfaceCompletionHandler *handler = (PaActivateAudioInterfaceCompletionHandler *)This;
return ++ handler->refs; return ++ handler->refs;
} }
static ULONG ( STDMETHODCALLTYPE CActivateAudioInterfaceCompletionHandler_Release )( static ULONG ( STDMETHODCALLTYPE PaActivateAudioInterfaceCompletionHandler_Release )(
IActivateAudioInterfaceCompletionHandler * This) IActivateAudioInterfaceCompletionHandler * This)
{ {
CActivateAudioInterfaceCompletionHandler *handler = (CActivateAudioInterfaceCompletionHandler *)This; PaActivateAudioInterfaceCompletionHandler *handler = (PaActivateAudioInterfaceCompletionHandler *)This;
if (handler->refs == 0) if (handler->refs == 0)
{ {
PaUtil_FreeMemory(handler->parent.lpVtbl); PaUtil_FreeMemory(handler->parent.lpVtbl);
@ -1291,12 +1289,12 @@ static ULONG ( STDMETHODCALLTYPE CActivateAudioInterfaceCompletionHandler_Releas
return -- handler->refs; return -- handler->refs;
} }
static HRESULT ( STDMETHODCALLTYPE CActivateAudioInterfaceCompletionHandler_ActivateCompleted )( static HRESULT ( STDMETHODCALLTYPE PaActivateAudioInterfaceCompletionHandler_ActivateCompleted )(
IActivateAudioInterfaceCompletionHandler * This, IActivateAudioInterfaceCompletionHandler * This,
/* [annotation][in] */ /* [annotation][in] */
_In_ IActivateAudioInterfaceAsyncOperation *activateOperation) _In_ IActivateAudioInterfaceAsyncOperation *activateOperation)
{ {
CActivateAudioInterfaceCompletionHandler *handler = (CActivateAudioInterfaceCompletionHandler *)This; PaActivateAudioInterfaceCompletionHandler *handler = (PaActivateAudioInterfaceCompletionHandler *)This;
HRESULT hr = S_OK; HRESULT hr = S_OK;
HRESULT hrActivateResult = S_OK; HRESULT hrActivateResult = S_OK;
@ -1324,13 +1322,13 @@ static HRESULT ( STDMETHODCALLTYPE CActivateAudioInterfaceCompletionHandler_Acti
static IActivateAudioInterfaceCompletionHandler *CreateActivateAudioInterfaceCompletionHandler() static IActivateAudioInterfaceCompletionHandler *CreateActivateAudioInterfaceCompletionHandler()
{ {
CActivateAudioInterfaceCompletionHandler *handler = PaUtil_AllocateMemory(sizeof(CActivateAudioInterfaceCompletionHandler)); PaActivateAudioInterfaceCompletionHandler *handler = PaUtil_AllocateMemory(sizeof(PaActivateAudioInterfaceCompletionHandler));
ZeroMemory(handler, sizeof(*handler)); ZeroMemory(handler, sizeof(*handler));
handler->parent.lpVtbl = PaUtil_AllocateMemory(sizeof(*handler->parent.lpVtbl)); handler->parent.lpVtbl = PaUtil_AllocateMemory(sizeof(*handler->parent.lpVtbl));
handler->parent.lpVtbl->QueryInterface = &CActivateAudioInterfaceCompletionHandler_QueryInterface; handler->parent.lpVtbl->QueryInterface = &PaActivateAudioInterfaceCompletionHandler_QueryInterface;
handler->parent.lpVtbl->AddRef = &CActivateAudioInterfaceCompletionHandler_AddRef; handler->parent.lpVtbl->AddRef = &PaActivateAudioInterfaceCompletionHandler_AddRef;
handler->parent.lpVtbl->Release = &CActivateAudioInterfaceCompletionHandler_Release; handler->parent.lpVtbl->Release = &PaActivateAudioInterfaceCompletionHandler_Release;
handler->parent.lpVtbl->ActivateCompleted = &CActivateAudioInterfaceCompletionHandler_ActivateCompleted; handler->parent.lpVtbl->ActivateCompleted = &PaActivateAudioInterfaceCompletionHandler_ActivateCompleted;
return (IActivateAudioInterfaceCompletionHandler *)handler; return (IActivateAudioInterfaceCompletionHandler *)handler;
} }
#endif #endif
@ -1339,22 +1337,23 @@ static IActivateAudioInterfaceCompletionHandler *CreateActivateAudioInterfaceCom
#ifdef WIN32_WINRT #ifdef WIN32_WINRT
static HRESULT ActivateAudioInterface_WINRT(const PaWasapiDeviceInfo *deviceInfo, IAudioClient **client) static HRESULT ActivateAudioInterface_WINRT(const PaWasapiDeviceInfo *deviceInfo, IAudioClient **client)
{ {
#define PA_WASAPI_DEVICE_PATH_LEN 64
PaError result = paNoError; PaError result = paNoError;
HRESULT hr = S_OK; HRESULT hr = S_OK;
HRESULT activateResult = S_OK;
IActivateAudioInterfaceAsyncOperation *asyncOp = NULL; IActivateAudioInterfaceAsyncOperation *asyncOp = NULL;
IActivateAudioInterfaceCompletionHandler *handler = CreateActivateAudioInterfaceCompletionHandler(); IActivateAudioInterfaceCompletionHandler *handler = CreateActivateAudioInterfaceCompletionHandler();
CActivateAudioInterfaceCompletionHandler *ñhandler = (CActivateAudioInterfaceCompletionHandler *)handler; PaActivateAudioInterfaceCompletionHandler *handlerImpl = (PaActivateAudioInterfaceCompletionHandler *)handler;
OLECHAR devicePath[64] = { 0 }; OLECHAR devicePath[PA_WASAPI_DEVICE_PATH_LEN] = { 0 };
// Get device path in form L"{DEVICE_GUID}" // Get device path in form L"{DEVICE_GUID}"
switch (deviceInfo->flow) switch (deviceInfo->flow)
{ {
case eRender: case eRender:
StringFromGUID2(&DEVINTERFACE_AUDIO_RENDER, devicePath, 63); StringFromGUID2(&DEVINTERFACE_AUDIO_RENDER, devicePath, PA_WASAPI_DEVICE_PATH_LEN - 1);
break; break;
case eCapture: case eCapture:
StringFromGUID2(&DEVINTERFACE_AUDIO_CAPTURE, devicePath, 63); StringFromGUID2(&DEVINTERFACE_AUDIO_CAPTURE, devicePath, PA_WASAPI_DEVICE_PATH_LEN - 1);
break; break;
default: default:
return S_FALSE; return S_FALSE;
@ -1366,13 +1365,13 @@ static HRESULT ActivateAudioInterface_WINRT(const PaWasapiDeviceInfo *deviceInfo
IF_FAILED_INTERNAL_ERROR_JUMP(hr, result, error); IF_FAILED_INTERNAL_ERROR_JUMP(hr, result, error);
// Wait in busy loop for async operation to complete // Wait in busy loop for async operation to complete
while (SUCCEEDED(hr) && !ñhandler->done) while (SUCCEEDED(hr) && !handlerImpl->done)
{ {
Pa_Sleep(1); Pa_Sleep(1);
} }
(*client) = ñhandler->out.client; (*client) = handlerImpl->out.client;
hr = ñhandler->out.hr; hr = handlerImpl->out.hr;
error: error:
@ -1380,6 +1379,8 @@ error:
SAFE_RELEASE(handler); SAFE_RELEASE(handler);
return hr; return hr;
#undef PA_WASAPI_DEVICE_PATH_LEN
} }
#endif #endif
@ -1414,11 +1415,12 @@ PaError PaWasapi_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiInd
PaWasapiHostApiRepresentation *paWasapi; PaWasapiHostApiRepresentation *paWasapi;
PaDeviceInfo *deviceInfoArray; PaDeviceInfo *deviceInfoArray;
HRESULT hr = S_OK; HRESULT hr = S_OK;
UINT i;
#ifndef WIN32_WINRT #ifndef WIN32_WINRT
IMMDeviceCollection* pEndPoints = NULL; IMMDeviceCollection* pEndPoints = NULL;
#endif #else
UINT i;
WAVEFORMATEX *mixFormat; WAVEFORMATEX *mixFormat;
#endif
#ifndef WIN32_WINRT #ifndef WIN32_WINRT
if (!SetupAVRT()) if (!SetupAVRT())
@ -1562,7 +1564,6 @@ PaError PaWasapi_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiInd
for (i = 0; i < paWasapi->deviceCount; ++i) for (i = 0; i < paWasapi->deviceCount; ++i)
{ {
DWORD state = 0;
PaDeviceInfo *deviceInfo = &deviceInfoArray[i]; PaDeviceInfo *deviceInfo = &deviceInfoArray[i];
deviceInfo->structVersion = 2; deviceInfo->structVersion = 2;
deviceInfo->hostApi = hostApiIndex; deviceInfo->hostApi = hostApiIndex;
@ -1603,7 +1604,7 @@ PaError PaWasapi_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiInd
if (paWasapi->devInfo[i].state != DEVICE_STATE_ACTIVE) if (paWasapi->devInfo[i].state != DEVICE_STATE_ACTIVE)
{ {
PRINT(("WASAPI device: %d is not currently available (state:%d)\n",i,state)); PRINT(("WASAPI device: %d is not currently available (state:%d)\n", i, paWasapi->devInfo[i].state));
} }
{ {
@ -1630,9 +1631,9 @@ PaError PaWasapi_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiInd
goto error; goto error;
} }
if (value.pwszVal) if (value.pwszVal)
WideCharToMultiByte(CP_UTF8, 0, value.pwszVal, (int)wcslen(value.pwszVal), deviceName, MAX_STR_LEN-1, 0, 0); WideCharToMultiByte(CP_UTF8, 0, value.pwszVal, (int)wcslen(value.pwszVal), deviceName, MAX_STR_LEN - 1, 0, 0);
else else
_snprintf(deviceName, MAX_STR_LEN-1, "baddev%d", i); _snprintf(deviceName, MAX_STR_LEN - 1, "baddev%d", i);
deviceInfo->name = deviceName; deviceInfo->name = deviceName;
PropVariantClear(&value); PropVariantClear(&value);
PA_DEBUG(("WASAPI:%d| name[%s]\n", i, deviceInfo->name)); PA_DEBUG(("WASAPI:%d| name[%s]\n", i, deviceInfo->name));
@ -1700,6 +1701,8 @@ PaError PaWasapi_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiInd
// Create temp Audio Client instance to query additional details // Create temp Audio Client instance to query additional details
IAudioClient *tmpClient = NULL; IAudioClient *tmpClient = NULL;
hr = ActivateAudioInterface(&paWasapi->devInfo[i], &tmpClient); hr = ActivateAudioInterface(&paWasapi->devInfo[i], &tmpClient);
// We need to set the result to a value otherwise we will return paNoError
// [IF_FAILED_JUMP(hResult, error);]
IF_FAILED_INTERNAL_ERROR_JUMP(hr, result, error); IF_FAILED_INTERNAL_ERROR_JUMP(hr, result, error);
// Get latency // Get latency
@ -1730,7 +1733,7 @@ PaError PaWasapi_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiInd
(*hostApi)->info.defaultInputDevice = (*hostApi)->info.deviceCount; (*hostApi)->info.defaultInputDevice = (*hostApi)->info.deviceCount;
// State // State
paWasapi->devInfo[i].state = 1; // DEVICE_STATE_ACTIVE paWasapi->devInfo[i].state = DEVICE_STATE_ACTIVE;
// Default format // Default format
memcpy(&paWasapi->devInfo[i].DefaultFormat, mixFormat, min(sizeof(paWasapi->devInfo[i].DefaultFormat), sizeof(*mixFormat))); memcpy(&paWasapi->devInfo[i].DefaultFormat, mixFormat, min(sizeof(paWasapi->devInfo[i].DefaultFormat), sizeof(*mixFormat)));
@ -1740,14 +1743,14 @@ PaError PaWasapi_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiInd
paWasapi->devInfo[i].formFactor = UnknownFormFactor; paWasapi->devInfo[i].formFactor = UnknownFormFactor;
// Name // Name
deviceInfo->name = PaUtil_GroupAllocateMemory(paWasapi->allocations, MAX_STR_LEN + 1); deviceInfo->name = (char *)PaUtil_GroupAllocateMemory(paWasapi->allocations, MAX_STR_LEN + 1);
if (deviceInfo->name == NULL) if (deviceInfo->name == NULL)
{ {
SAFE_RELEASE(tmpClient); SAFE_RELEASE(tmpClient);
result = paInsufficientMemory; result = paInsufficientMemory;
goto error; goto error;
} }
_snprintf(deviceInfo->name, MAX_STR_LEN - 1, "WASAPI_%s:%d", (i == 0 ? "Output" : "Input"), i); _snprintf((char *)deviceInfo->name, MAX_STR_LEN - 1, "WASAPI_%s:%d", (i == 0 ? "Output" : "Input"), i);
PA_DEBUG(("WASAPI:%d| name[%s]\n", i, deviceInfo->name)); PA_DEBUG(("WASAPI:%d| name[%s]\n", i, deviceInfo->name));
} }
#endif #endif
@ -1858,15 +1861,15 @@ static void Terminate( PaUtilHostApiRepresentation *hostApi )
SAFE_RELEASE(paWasapi->enumerator); SAFE_RELEASE(paWasapi->enumerator);
#endif #endif
// Release device info bound objects and device info itself
for (i = 0; i < paWasapi->deviceCount; ++i) for (i = 0; i < paWasapi->deviceCount; ++i)
{ {
PaWasapiDeviceInfo *info = &paWasapi->devInfo[i]; PaWasapiDeviceInfo *info = &paWasapi->devInfo[i];
#ifndef WIN32_WINRT #ifndef WIN32_WINRT
SAFE_RELEASE(info->device); SAFE_RELEASE(info->device);
#else
(void)info;
#endif #endif
//if (info->MixFormat)
// CoTaskMemFree(info->MixFormat);
} }
PaUtil_FreeMemory(paWasapi->devInfo); PaUtil_FreeMemory(paWasapi->devInfo);
@ -2211,6 +2214,7 @@ static PaError GetClosestFormat(IAudioClient *myClient, double sampleRate,
WAVEFORMATEX *sharedClosestMatch = NULL; WAVEFORMATEX *sharedClosestMatch = NULL;
HRESULT hr = !S_OK; HRESULT hr = !S_OK;
PaStreamParameters params = (*_params); PaStreamParameters params = (*_params);
(void)output;
/* It was not noticed that 24-bit Input producing no output while device accepts this format. /* It was not noticed that 24-bit Input producing no output while device accepts this format.
To fix this issue let's ask for 32-bits and let PA converters convert host 32-bit data To fix this issue let's ask for 32-bits and let PA converters convert host 32-bit data
@ -2552,7 +2556,7 @@ static HRESULT CreateAudioClient(PaWasapiStream *pStream, PaWasapiSubStream *pSu
const PaStreamParameters *params = &pSub->params.stream_params; const PaStreamParameters *params = &pSub->params.stream_params;
UINT32 framesPerLatency = pSub->params.frames_per_buffer; UINT32 framesPerLatency = pSub->params.frames_per_buffer;
double sampleRate = pSub->params.sample_rate; double sampleRate = pSub->params.sample_rate;
BOOL blocking = pSub->params.blocking; //BOOL blocking = pSub->params.blocking;
BOOL fullDuplex = pSub->params.full_duplex; BOOL fullDuplex = pSub->params.full_duplex;
const UINT32 userFramesPerBuffer = framesPerLatency; const UINT32 userFramesPerBuffer = framesPerLatency;
@ -3558,6 +3562,7 @@ HRESULT UnmarshalSubStreamComPointers(PaWasapiSubStream *substream)
return hFirstBadResult; return hFirstBadResult;
#else #else
(void)substream;
return S_OK; return S_OK;
#endif #endif
} }
@ -3678,6 +3683,7 @@ marshal_sub_error:
ReleaseUnmarshaledSubComPointers(substream); ReleaseUnmarshaledSubComPointers(substream);
return hResult; return hResult;
#else #else
(void)substream;
return S_OK; return S_OK;
#endif #endif
} }
@ -3727,6 +3733,7 @@ marshal_error:
ReleaseUnmarshaledComPointers(stream); ReleaseUnmarshaledComPointers(stream);
return hResult; return hResult;
#else #else
(void)stream;
return S_OK; return S_OK;
#endif #endif
} }
@ -4436,6 +4443,7 @@ HANDLE MMCSS_activate(const char *name)
return hTask; return hTask;
#else #else
(void)name;
return NULL; return NULL;
#endif #endif
} }
@ -4572,6 +4580,8 @@ error:
LogHostError(hr); LogHostError(hr);
return paNoError; return paNoError;
#else #else
(void)nDevice;
(void)jcount;
return paUnanticipatedHostError; return paUnanticipatedHostError;
#endif #endif
} }
@ -4749,6 +4759,9 @@ error:
return ret; return ret;
#else #else
(void)nDevice;
(void)jindex;
(void)pJackDescription;
return paUnanticipatedHostError; return paUnanticipatedHostError;
#endif #endif
} }
@ -4975,7 +4988,7 @@ PA_THREAD_FUNC ProcThreadEvent(void *param)
if (FAILED(hr) && (hr != RPC_E_CHANGED_MODE)) if (FAILED(hr) && (hr != RPC_E_CHANGED_MODE))
{ {
PRINT(("WASAPI: failed ProcThreadEvent CoInitialize")); PRINT(("WASAPI: failed ProcThreadEvent CoInitialize"));
return paUnanticipatedHostError; return (UINT32)paUnanticipatedHostError;
} }
if (hr != RPC_E_CHANGED_MODE) if (hr != RPC_E_CHANGED_MODE)
bThreadComInitialized = TRUE; bThreadComInitialized = TRUE;
@ -5182,7 +5195,7 @@ PA_THREAD_FUNC ProcThreadPoll(void *param)
if (FAILED(hr) && (hr != RPC_E_CHANGED_MODE)) if (FAILED(hr) && (hr != RPC_E_CHANGED_MODE))
{ {
PRINT(("WASAPI: failed ProcThreadPoll CoInitialize")); PRINT(("WASAPI: failed ProcThreadPoll CoInitialize"));
return paUnanticipatedHostError; return (UINT32)paUnanticipatedHostError;
} }
if (hr != RPC_E_CHANGED_MODE) if (hr != RPC_E_CHANGED_MODE)
bThreadComInitialized = TRUE; bThreadComInitialized = TRUE;

View file

@ -52,11 +52,11 @@
#define WAVE_FORMAT_PCM 1 #define WAVE_FORMAT_PCM 1
typedef struct tWAVEFORMAT typedef struct tWAVEFORMAT
{ {
WORD wFormatTag; WORD wFormatTag;
WORD nChannels; WORD nChannels;
DWORD nSamplesPerSec; DWORD nSamplesPerSec;
DWORD nAvgBytesPerSec; DWORD nAvgBytesPerSec;
WORD nBlockAlign; WORD nBlockAlign;
} }
WAVEFORMAT; WAVEFORMAT;
#endif #endif
@ -66,13 +66,13 @@ WAVEFORMAT;
#define _WAVEFORMATEX_ #define _WAVEFORMATEX_
typedef struct tWAVEFORMATEX typedef struct tWAVEFORMATEX
{ {
WORD wFormatTag; WORD wFormatTag;
WORD nChannels; WORD nChannels;
DWORD nSamplesPerSec; DWORD nSamplesPerSec;
DWORD nAvgBytesPerSec; DWORD nAvgBytesPerSec;
WORD nBlockAlign; WORD nBlockAlign;
WORD wBitsPerSample; WORD wBitsPerSample;
WORD cbSize; WORD cbSize;
} }
WAVEFORMATEX; WAVEFORMATEX;
#endif #endif