Android Question AudioStreamer Echo

Addo

Well-Known Member
Licensed User
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



B4X:
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

B4X:
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 ?
 

mohammad be

Member
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



B4X:
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

B4X:
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 ?
Hello
I have a problem with sound reflection like your program
Did you find a solution?
 
Upvote 0
Top