![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Sep 2005
Posts: 2
Rep Power: 0
![]() |
Audio Level
I am quite new to C programming, but have grasped the concept quite well and am interested in writing a function that can be used to run an audio level meter.
This function should return a number depending on the loudness of the input comming from the microphone on a laptop. I scoured the internet, but cannot find a way of retrieving sound from the input for processing, i can record it but that doesnt help Any ideas would be appreciated! Thank you ![]() |
|
|
|
|
|
#2 |
|
Programming Guru
![]() |
If you can record it, then it becomes a matter of analyzing the data you're getting from the mic
__________________
|
|
|
|
|
|
#3 |
|
Professional Programmer
|
Sounds like you need to investigate the Fourier Transform. It takes audio data and represents it as Hertz and Decibels.
http://en.wikipedia.org/wiki/Fast_Fourier_transform http://mathworld.wolfram.com/FastFourierTransform.html http://www.fftw.org/ http://astronomy.swin.edu.au/~pbourke/other/dft/ http://homepages.inf.ed.ac.uk/rbf/CV...LL/node20.html http://en.wikipedia.org/wiki/Discrete_Fourier_transform
__________________
% rc4 hexkey < input > output
#define S ,t=s[i],s[i]=s[j],s[j]=t /* rc4 hexkey <file */
unsigned char k[256],s[256],i,j,t;main(c,v,e)char**v;{++v;while(++i)s[
i]=i;for(c=0;*(*v)++;k[c++]=e)sscanf((*v)++-1,"%2x",&e);while(j+=s[i]
+k[i%c]S,++i);for(j=0;c=~getchar();putchar(~c^s[t+=s[i]]))j+=s[++i]S;} |
|
|
|
|
|
#4 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
When you say you can record it, does that mean with your own software, or just with one of your existing apps?
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
|
|
#5 |
|
Newbie
Join Date: Sep 2005
Posts: 2
Rep Power: 0
![]() |
I apologise for it taking ages to reply to this, i thought i subscribed to this so i get e-mails when new posts are made
![]() I have found bits and peices that can record the microphone input to a wav file, but not tried writing a program based on that information, as i have no idea how to intercept, or read back the information recorded. I have read the fourier pages and it looks like its helpful, what i need now is some help writing the code to get the sample voltages from the microphone to variables in a program. I dont even know which API to use... Or if there is an alternative ![]() |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|