View Single 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: