--------------9924FD8D928AFB836D64F407
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Hi,
Can anyone please help with me with code to record sound data (in wave
format) from microphone.
I have the code to read data from the microphone; the wave data is
getting stored in m_WaveHeader.lpData where m_WaveHeader is a structure
of type WAVEHDR.
Now my objective is to read this data and look for a particular
frequency of sound. For that I am first storing the data in WAVEHDR in a
file.
I wrote the following code for this but it seems it is not right:-
for (DWORD j=0;j< dwBufferSize/10;j++)
fprintf(fp,"%d\n",*((short*)&(m_WaveHeader.lpData[j])));
where dwBufferSize is the size of the audio data buffer.
Pls can anyone tell me how to modify this code to get the correct data?
Atri.
--------------9924FD8D928AFB836D64F407
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
Hi,
<br>Can anyone please help with me with code to record sound data (in wave
format) from microphone.
<br>I have the code to read data from the microphone; the wave data
is getting stored in m_WaveHeader.lpData where m_WaveHeader is a structure
of type WAVEHDR.
<br>Now my objective is to read this data and look for a particular
frequency
of sound. For that I am first storing the data in WAVEHDR in a file.
<br>I wrote the following code for this but it seems it is not right:-
<br> <i>for (DWORD j=0;j< dwBufferSize/10;j++)</i>
<br><i> fprintf(fp,"%d\n",*((short*)&(m_WaveHeader.lpData[j])));</i>
<p>where dwBufferSize is the size of the audio data buffer.
<p>Pls can anyone tell me how to modify this code to get the correct data?
<p>Atri.</html>
--------------9924FD8D928AFB836D64F407--