0

I am developing VOIP kind of application. Sending the voice is perfect but when i receive the same voice from the webserver, i am playing back that using AudioTrack API.

I am calling at.play() and at.write in a Thread so that i should get all the voice which is recorded and sent from the other device.

But, now the problem here i m facing is, if there is no voice than its still playing like some bullet sound, i mean there is a continuos background sound when i try to play .

I m using this following function in a Thread:

                   if (at != null) {
                        if (at.getPlayState() != AudioTrack.PLAYSTATE_PLAYING) {
                            at.play();
                   } else {
                       if (playing == true) {
                                System.out.println("BEFORE WRITE");
                                at.write(playShortData, 0,
                                        playShortData.length);
                                System.out.println("AFTER WRITE");

                                at.flush();
                                playing = false;
                            }
                        }
                    }

How can i remove the background noise if there no voice is send from other device.

G M Ramesh
  • 3,420
  • 9
  • 37
  • 53
  • You should do some signal processing. It's usually done using Android NDK: http://developer.android.com/tools/sdk/ndk/index.html – sinisha Dec 14 '12 at 11:27
  • @sinisha, i dont want to use any NDK... I just wanted to use Existing API's to work – G M Ramesh Dec 14 '12 at 11:37
  • @sinisha, In my another application, there is no background noise and i m using same AUdiotrack there also ... – G M Ramesh Dec 14 '12 at 11:39
  • Are you sure there isn't problem during recording? – sinisha Dec 14 '12 at 11:41
  • Yeah i m 100% sure....because before sending it to server, i m storing that it into a sd card and playing externally... it was playing fine with no issues – G M Ramesh Dec 14 '12 at 11:46
  • What recording source are you using? Some source is optimized for voice recording, which includes some DSP for compression and gates. A gate is what you're looking for. – Brad Dec 15 '12 at 02:20

1 Answers1

0

I think its playing Junk value when none of them is speaking on other sides, its just sending junk values ..

G M Ramesh
  • 3,420
  • 9
  • 37
  • 53