Reply
Thread Tools
Posts: 145 | Thanked: 304 times | Joined on Jan 2010 @ Milton Keynes, UK
#1
Hi Guys,

Can anybody point me in the right direction for a simple way to read the values from the Microphone?

I'm not interested in recording the results just a simple method of monitoring volume from the built in mic. Something as simple as the sysfs method of reading the accelerometer would be awesome, is this possible?

Cheers
Jamie
 
noobmonkey's Avatar
Posts: 3,203 | Thanked: 1,391 times | Joined on Nov 2009 @ Worthing, England
#2
Working on that at the moment, i can get a pulse-audio recording working... - but not sure on peeling out any extra information at the moment...

(Using 'parec' to record) - i think that is a good start- but pulseaudio commands arn't easy to figure out
__________________
----------- Follow me on Twitter here
----------- My Photography Website and Blog is here
----------- Author of the N900 Health Check Application ----------- New Version in Extras Devel (Dec 2010 - 2.9.10)
----------- Are you on the N900 World Map? - http://pininthemap.com/maemo - masterpin: shotgun
----------- What apps do you want to see on the n900 or in MeeGo in the future? -
 

The Following User Says Thank You to noobmonkey For This Useful Post:
Posts: 631 | Thanked: 837 times | Joined on May 2007 @ Milton, Ontario, Canada
#3
In short, no you're not going to have a simple way of doing it... nowhere near as simple as sysfs... audio just does not work that way in Linux (or anywhere in general it seems). I looked into this a while ago and hacked up a version of arecord (alsa's cli recording tool) to do exactly what you describe... it would sit there "listening" to the microphone and spit out the "detected sound level" so a file that you could then poll from other applications.

Unfortunately I didn't ever get it working on the NITs because at the time they didn't have proper ALSA libs working (or maybe I just couldn't get them to compile, don't remember now it was a while ago), but if the N900/maemo5 has proper ALSA support now it might work. As far as doing it through pulse... eee I've never used the pulse api, but last time I looked I didn't see anything even indicating how you'd start going about doing it...
 

The Following User Says Thank You to jolouis For This Useful Post:
Reply


 
Forum Jump


All times are GMT. The time now is 10:22.