Android Question speakerphone

Igor_zenon

Member
Licensed User
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?
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Interesting. You can add this effect with this code (depends on Reflection and JavaObject libraries):
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
End Sub
Call it after you initialize the streamer.
Set the minSdkVersion to 16 (Android 4.1).
 
Upvote 0
Top