You are not logged in.
Pages: 1
Hi,
I want to display the current sound level by the default mic input.
I don't really care what language it is. Just some pointers would be great.
Thanks,
x5x_tim
Offline
Hi,
I want to display the current sound level by the default mic input.
I don't really care what language it is. Just some pointers would be great.Thanks,
x5x_tim
i suggest that you go with rtaudio (http://www.music.mcgill.ca/~gary/rtaudio/) because it's one of the simplest. there are examples on web site how to get sound from input (it's in c/c++). you'll get a block of audio data in a float array and you can do whatever you want with it.
sound level can be measured for example with average power - you sum all the squared elements of an array with soud data, divide it with block size, and that's it. this way, if your block size is too small (256 samples or less) average power will be changing quickly - you can average that value during the few last blocks to get more smooth value to display.
when you have that working, go with the gui. you can choose any toolkit you want. qt is very nice because it is very powerful, easy to grasp, and has a great ide (qtcreator). one simple window with progress bar should be enough. if you want something more fancy, you can make your own widget or do some css styling on standard widget, but you can take a look at that by yourself if you want.
Last edited by igor_b (2010-06-14 20:38:13)
Offline
Thanks, I played with the examples a while.
I couldn't get record to actually record any sound though, while Audacity can.
Anyway, thanks for the suggestion, the recording problem seems to be on my side, as I get the same with arecord.
Offline
Thanks, I played with the examples a while.
I couldn't get record to actually record any sound though, while Audacity can.
Anyway, thanks for the suggestion, the recording problem seems to be on my side, as I get the same with arecord.
check alsamixer, capture tab. maybe microphone is not selected for capture..
audacity uses portaudio for audio i/o. portaudio is another pretty cool cross platform audio system. i've never actually used it, but you cantry . it shouldn't be much different from rtaudio.
Last edited by igor_b (2010-06-16 10:11:04)
Offline
Pages: 1