Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Gaming > Development Audio > Problem in reco...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 1 Topic 37 of 129
Post > Topic >>

Problem in recording data from microphone

by Atri Mandal <mandala@[EMAIL PROTECTED] > Dec 24, 2003 at 05:28 PM

--------------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;&nbsp; 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>&nbsp;<i>for (DWORD j=0;j&lt; dwBufferSize/10;j++)</i>
<br><i>&nbsp;fprintf(fp,"%d\n",*((short*)&amp;(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--




 1 Posts in Topic:
Problem in recording data from microphone
Atri Mandal <mandala@[  2003-12-24 17:28:19 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri May 16 22:25:15 CDT 2008.