Hi Neha,

Did you find a solution to the feedback cancellation problem for android?

Thanks.
Swapnil.

On Thursday, May 26, 2011 at 11:28:29 AM UTC+2, neha wrote:
>
> Is there any way to synchronize the capturing and playback of audio 
> data in Android? 
>
> I am using audioRecord/track to achieve this.But its producing echo. 
> Is there any way to cancel echo. 
> My code is- 
>                                 { 
>                                 isRecording=true; 
>
>                                   bufferSize = 
> AudioRecord.getMinBufferSize(8000,AudioFormat.CHANNEL_CONFIGURATION_MONO,AudioFormat.ENCODING_PCM_16BIT);
>  
>
>                                 audioRecord = new 
> AudioRecord(MediaRecorder.AudioSource.MIC, 
>                                 8000, 
> AudioFormat.CHANNEL_CONFIGURATION_MONO,AudioFormat.ENCODING_PCM_16BIT, 
> bufferSize); 
>
>                                 audioRecord.startRecording(); 
>
>                                 int BUFFER_SIZE_IN_BYTES 
> =AudioTrack.getMinBufferSize(RECORDER_SAMPLERATE,AudioFormat.CHANNEL_CONFIGURATION_MONO,RECORDER_AUDIO_ENCODING);
>  
>
>                                 AudioTrack audioTrack = new 
> AudioTrack(AudioManager.STREAM_SYSTEM, 
>                
>                                          
> 8000,AudioFormat.CHANNEL_CONFIGURATION_MONO, 
>
>                
>                                          AudioFormat.ENCODING_PCM_16BIT, 
> BUFFER_SIZE_IN_BYTES, 
>                
>                                          AudioTrack.MODE_STREAM); 
>                                 byte[] buffer=new byte[400]; 
>                                 audioTrack.play(); 
>                                     while (isRecording) { int bytesRead = 
> audioRecord.read(buffer, 
> 0, 
>                                     400); 
>                                 int bytesWritten = 
> audioTrack.write(buffer, 0, 400); 
>
>                                     }

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/a000cfbe-a512-4f12-848e-8247c5751281%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to