waveform audio API question
Posted on 1998-11-19
I am trying to do a simple audio loopback program that will read in audio from the mic and send it out to the speaker immediately.
Here is my problem:
In the callback function for input audio (waveInProc) I get the wave header structure copy the data to a queue and try to send the buffer back to the device using waveInAddbuffer. However when I do this the application locks up. While stepping through the code when I get to the waveInAddBuffer call the function never returns. What makes this even more weird is that the code I have written works fine under Windows98, but when I try to run it under WinNT 4.0 it will lock up.
Anyone have any ideas why this is happening?
Here is my waveInProc function:
void CALLBACK waveInProc(HWAVEIN hwi, UINT uMsg, DWORD dwInstance, DWORD dwParam1, DWORD dwParam2)
lpHeader = (LPWAVEHDR) dwParam1;
lpTempBuf = lpHeader->lpData;
lpHeader->lpData = lpTempBuf;
lpHeader->dwFlags = 0;