Appropriate audio capture and noise reduction
Asked Answered
S

3

2

In my android application I need to capture the user's speech from the microphone and then pass it to the server. Currently, I use the MediaRecorder class. However, it doesn't satisfy my needs, because I want to make glowing effect, based on the current volume of input sound, so I need an AudioStream, or something like that, I guess. Currently, I use the following:

    this.recorder = new MediaRecorder();
    this.recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
    this.recorder.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4);
    this.recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
    this.recorder.setOutputFile(FILENAME);

I am writing using API level 7, so I don't see any other AudioEncoders, but AMR Narrow Band. Maybe that's the reason of awful noise which I hear in my recordings.

The second problem I am facing is poor sound quality, noise, so I want to reduct (cancel, suppress) it, because it is really awful, especially on my noname chinese tablet. This should be server-side, because, as far as I know, requiers a lot of resources, and not all of the modern gadgets (especially noname chinese tablets) can do that as fast as possible. I am free to choose, which platform to use on the server, so it can be ASP.NET, PHP, JSP, or whatever helps me to make the sound better. Speaking about ASP.NET, I have come across a library, called NAudio, may be it can help me in some way. I know, that there is no any noise reduction solution built in the library, but I have found some examples on FFT and auto-corellation using it, so it may help.
To be honest, I have never worked with sound this close before and I have no idea where to start. I have googled a lot about noise reduction techniques, code examples and found nothing. You guys are my last hope.
Thanks in advance.

Summers answered 18/6, 2012 at 17:7 Comment(1)
Maybe you could split this question into two: (1) how to capture audio on Android? and (2) how to reduce noise (on the server)?Ruffin
G
8

Have a look at this article.

Long story short, it uses MediaRecorder.AudioSource.VOICE_RECOGNITION instead of AudioSource.MIC, which gave me really good results and noise in the background did reduce very much.

The great thing about this solution is, it can be used with both AudioRecord and MediaRecorder class.

Guilbert answered 19/6, 2015 at 6:18 Comment(0)
R
1

For audio capture you can use the AudioRecord class. This lets you record raw audio, i.e. you are not restricted to "narrow band" and you can also measure the volume.

Ruffin answered 19/6, 2012 at 16:30 Comment(0)
L
0

Many smartphones have two microphones, one is the MIC you are using, the other one is near camera for video shooting, called CAMCORDER. You can get data from both of them to do noise reduction. There are many papers talking about audio noise reduction with multiple microphones.

Ref: http://developer.android.com/reference/android/media/MediaRecorder.AudioSource.html

https://www.google.com/search?q=noise+reduction+algorithm+with+two+mic

Liturgics answered 26/1, 2013 at 23:37 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.