|
Hi All,
Can anyone know how to find the audio level from the microphone? Basically I want to splitup the audio level from no audio(if the person is silent) to very high level... How can i get the frequency??
Thanks,
Poornima
|
|
|
|
|
|
Hello Poornima,
You could also try the FFTW subroutine library. The functions are easy to use and
competitive with vendor tuned code.
http://www.fftw.org/
|
|
|
|
|
Thanks a lot for the guidance.
|
|
|
|
|
What do you want - audio level (volume) or audio tone (frequency) or both?
FFT will give you frequency and a volume-related value at each frequency.
If you want only volume, you could calculate an average peak-to-peak value for some period as an estimate.
|
|
|
|
|
Hey,
I dont understand your question... Frequncy and volume are interelated rite... I mean frequency directly proportional to audio ???
do clear me If i am wrong.
|
|
|
|
|
Volume is how loud the sound is (a soft sound, like someone wispering, has low volume, a loud sound, like a fighter aircraft engine, has high volume.)
Frequency is the pitch or tone of a sound - a double bass plays notes which have a low frequency (a low cycle per second or Herz value) while a penny whistle plays notes which have a high frequency.
The frequency and the volume of a sound are not really related, although human perception does come into it.
The normal PC software volume control only controls volume, it does not affect frequency.
From your original question, I think you were trying to decide whether a sound was soft or loud, i.e. volume. My point was that you should be able to determine this in a simpler way than doing an FFT.
|
|
|
|
|
Let's say you have a block of audio data from the microphone (you could use the WaveIn functions - see http://msdn.microsoft.com/library/default.asp?url=/library/en-us/multimed/htm/_win32_waveform_functions.asp[^] .)
The data block has a number of characteristics which you specify, such as block length (50 or 100 milliseconds is reasonable), sampling rate (22 kHz should be OK), sample size (8 or 16 bit per sample), stereo or mono (microphone is probably mono.)
The general procedure I would follow would be:
Long SumOfSamples = 0
Long SumOfSquaredDifferences = 0
For count = 1 to numberSamplesInBlock
SumOfSamples += soundSample[count]
AverageSoundLevel = SumOfSamples / numberSamplesInBlock
For count = 1 to numberSamplesInBlock
ThisSampleDifference = sample[count] - AverageSoundLevel
SumOfSquaredDifferences += ThisSampleDifference * ThisSampleDifference
AverageDifference = SquareRoot(SumOfSquaredDifferences) / numberSamplesInBlock
If AverageDifference < softSoundThreshold
Display "The Sound Is Soft"
Else if AverageDifference > loudSoundThreshold
Display "The Sound Is Loud"
Else
Display "The Sound Is Between Soft And Loud Limits"
|
|
|
|
|
I need a virtual drive in ram , not in hard disk .
plz help me.
|
|
|
|
|
I saw like your question in another sites
and they want to create or lock virtual ram
can you be more specific.
|
|
|
|
|
I need a software , a example , a prescription ,the last word a way to create a virtual drive in ram , for example to create a file on it like other drives and adress it like "E:\" .
if you know anything like that please tell me .
tank you
|
|
|
|
|
This[^] is one tool that I found. I haven't used it though.
You can google with the term RamDisk to get some specific hits.
Nibu thomas
Software Developer
|
|
|
|
|
thanks a lot , it was useful to me .
|
|
|
|
|
V_shr wrote: thanks a lot , it was useful to me
So! What are you upto...:smugging:;P
Nibu thomas
Software Developer
|
|
|
|
|
|
thanks but my problem already solved.
|
|
|
|
|
Hi,
My requirement is that I have to login to an SSO enabled Server from a dialog based application. Can anyone guide me? I serched the WEB but got nothing on it.
Thanks.
---
With best regards,
A Manchester United Fan
The Genius of a true fool is that he can mess up a foolproof plan!
|
|
|
|
|
I want to select a device without UI , I looked "selecting a device" in msdn and I know that it is what I need , but I cant understand what is it.
plz help me
|
|
|
|
|
What device are you talking about ??
Could you be more specific (a LOT more specific) ?
|
|
|
|
|
I need to choose 1 webcam from webcames connected to computer without UI.
|
|
|
|
|
These webcams are USB devices ? Do you have drivers provided with them ? Or what driver are you using.
What do you need to do to communicate with your webcam when only one is installed (using CreateFile to open the driver for example) ?
I will try to help you but I'm not sure at all I can provide you a solution.
|
|
|
|
|
the webcams connect with USB port , and their drivers are installed ,
I looked msdn an I found this :
Call "CoCreateInstance" to retrieve a pointer to the "IWiaDevMgr" interface.
Use the "IWiaDevMgr::EnumDeviceInfo" method of the "IWiaDevMgr" interface to obtain a pointer to the "IEnumWIA_DEV_INFO" interface.
Use "IEnumWIA_DEV_INFO" interface to obtain "IWiaPropertyStorage" interface pointers for each WIA device enumerated.
Use "IWiaPropertyStorage" interface to inspect the device information properties of each device and save the "WIA_DIP_DEV_ID" property from the desired device.
Use the "DeviceID" property with the "IWiaDevMgr::CreateDevice" method in the "IWiaDevMgr" interface to create a WIA device object. The "IWiaDevMgr::CreateDevice method" provides the application with the pointer to the IWiaItem interface of the root item of the specified device.
example for create a device :
HRESULT CreateWiaDevice( IWiaDevMgr *pWiaDevMgr, BSTR bstrDeviceID, IWiaItem **ppWiaDevice )
{
if (NULL == pWiaDevMgr || NULL == bstrDeviceID || NULL == ppWiaDevice)
{
return E_INVALIDARG;
}
*ppWiaDevice = NULL;
HRESULT hr = pWiaDevMgr->CreateDevice( bstrDeviceID, ppWiaDevice );
return hr;
}
I know that this is what I need , but I cant understand it .
plz help me
|
|
|
|
|
|
// Activate (with the Default/first device)
SelCapDrvProc(hwndMain,WM_COMMAND,SELCAPDRVDLG_BUTTON,0);
and this actives the default (first) camera and I want to change the default .
|
|
|
|
|
From google it looks like you are making reference to some code in some project available on Planet Source Code?
Edit: I've found the source from Planet Source Code. It uses Video For Windows, so I'm not sure what your previous post was about.
For reference the source is located at http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=2679&lngWId=3[^]
You would like to use this and just change it to use a particular webcam? You could just modify EnumCapDrv and only add that particular webcam to the listbox. The code for the project in general looks like it could be a little buggy, but I think it already demonstrates everything you want to know? Like getting devices using capGetDriverDescription()?
-- modified at 5:34 Thursday 4th May, 2006
|
|
|
|