i have built a multiable audio conversation using 2 audiostreamer objects works so far so good when both ends use a head phones.
if 1 of those receivers doesnt have a headphone a huge echo starts to appear
i wonder how current voice conversation apps like whatsapp handle this ?
weather there is heaphones or not no echo produced
i have searched in forum about a solution for such case
i came up with the following
Dear colleagues, Help find out: There is a possibility along with a library AudioStreamer to use the API function speakerphone, excluding the effect of the positive feedback, as is done in telephone with speakerphone?
Sub SetEchoCanceler
Dim echo As JavaObject
echo.InitializeStatic("android/media/audiofx/AcousticEchoCanceler".Replace("/", "."))
If echo.RunMethod("isAvailable", Null) = True Then
Dim r As Reflector
r.Target = streamer
Dim AudioRecord As JavaObject = r.GetField("audioRecord")
echo.RunMethod("create", Array(AudioRecord.RunMethod("getAudioSessionId", Null)))
Log("echo set")
Else
Log("Echo not available")
End If
i applied this after initializing both audiostreamer but it isn't change anything the echo became worse
both audiostreamer parameters as the following
audioStream.Initialize2(1, "AudioStream", 8000, True, 16, audioStream.VOLUME_MUSIC)
audioStream2.Initialize2(1, "audioStream2", 8000, True, 16, audioStream.VOLUME_MUSIC)
End Sub[/CODE]
any idea how to handle such echo case ?