Detect Audio from microphone

All your problems with Audio, Video and Images.

Detect Audio from microphone

Postby stone4000 » Tue Aug 04, 2009 3:30 pm

I want to detect the volume of audio from the microphone in my application,
like in the application Steamy Window, where you have to blow to
make the window steamy again.

Can anyone help me?

thx in advance
stone4000
Freshman
Freshman
 
Posts: 2
Joined: Tue Mar 24, 2009 7:53 pm

Top

Postby maxpayne22 » Mon Aug 17, 2009 12:19 pm

you may find the read() method of AudioRecord useful for you. An AudioRecord records the sound into a buffer, and read() reads from the buffer. you can check whether the buffer contains high values, and hence, high volume sound.
hope this will help!
maxpayne22
Freshman
Freshman
 
Posts: 3
Joined: Sat May 02, 2009 2:32 pm

Postby Skeniver » Thu Jan 21, 2010 12:30 pm

Hey maxpayne

Could you provide a little more detail on how this is done?

I am interested in doing the same thing, but am completely new to the 'Audio' area of Android.

Thanks in advance
Neil
Follow me on twitter -> http://twitter.com/Skeniver
Apps & blog -> http://www.formidableapps.co.uk
User avatar
Skeniver
Senior Developer
Senior Developer
 
Posts: 106
Joined: Tue Feb 03, 2009 3:51 pm
Location: Canterbury, UK

Postby neex1233 » Sun Mar 28, 2010 3:30 am

Does anybody know how to do this?
neex1233
Freshman
Freshman
 
Posts: 4
Joined: Wed Mar 24, 2010 3:46 pm

Postby stealthcopter » Thu Apr 01, 2010 11:26 am

I would also be interested in how this is acheived
stealthcopter
Junior Developer
Junior Developer
 
Posts: 12
Joined: Sun Jan 17, 2010 11:42 am

Postby BenRose3d » Mon Apr 05, 2010 10:21 pm

I've not done this on an android (new to android development and this forum actually), but I wanted to share my idea of how I'd attain volumes from the microphone(s).

Various links for gathering audio:
http://developer.android.com/guide/topi ... index.html
and
http://developer.android.com/reference/ ... order.html
and
http://developer.android.com/reference/ ... ecord.html

Concerning volume, I guess you can pick some levels for arbitrary volume granularity as may be inferred from the first few paragraphs here:
http://www.ypass.net/blog/2010/01/pcm-a ... e-control/

So you could have some algorithm that over a certain amount of time would take the absolute values (remove negatives), get the average of those numbers (with or without outliers, I don't know) then compare them to some volume cutoff values you have selected. This could run in the background and have overlapping samples over time.

You may find going with the median is better for your purposes.

Alternatively, you could have it return a positive verification once a certain level has been reached in the raw pcm values (probably absolute values unless you're particular).
BenRose3d
Freshman
Freshman
 
Posts: 3
Joined: Mon Apr 05, 2010 10:12 pm

Top

Return to Multimedia Problems

Who is online

Users browsing this forum: Yahoo [Bot] and 11 guests