audio-streamingandroid-audiorecord

Detect audio only from 10 cm. Stream audio only when person speaks android


I am developing a conference system where all the phones are connected to each other via google nearby services api. I have followed the tutorial of google walkie talkie from this link: https://github.com/googlesamples/android-nearby/tree/master/connections/walkietalkie in this tutorial the person must press volume key to talk. What I want is that the person should not press the voulume key but when he starts to talk it should stream the voice. For this I followed the following link: Voice Detection in Android Application but when I test it the voice is breaking and not able to listen exactly what other person is saying. I have tested RECORDER_SAMPLERATE with 8000 and also with 44100 but no success. Also I want my mic to only stream the voice that is coming from 10 cm only. E.g if the person is talking in 10 cm it should stream the voice and the person talking next to him and he is far than 10 cm mic should not catch his voice.


Solution

  • You can use FFmpeg for the noize cancellation process. There is a good FFmpeg wrapper for Android. you can navigate to this https://github.com/WritingMinds/ffmpeg-android-java repo. Then integrate this FFmpeg in android.

    After that, u can use below command to noize reduction

    ffmpeg -i <input_file> -af "highpass=f=200, lowpass=f=3000" <output_file>
    

    This will simply reduce noize. I thought this range will give u a good noize cancellation. You can change it according to what you want. But you can do a lot of things using the FFmpeg library. It is a very powerful library. Navigate to https://ffmpeg.org/ffmpeg.html this. You can find lots of audio editing command. most of them can use within this FFmpeg android wrapper. I think you need to replace ffmpeg by -y to execute command in that FFmpeg wrapper