Android Question ExoPlayer and EQLib

Agnetha

Member
Licensed User
Longtime User
Hello!
Is it possible to use the Equalizer Library (EQLib) together with the Exoplayer?
I can't get the AudioSessionId of the Exoplayer.
Always returns '0'.

B4X:
Dim R As Reflector
R.Target=Player1
R.Target=R.GetField("player")
 
Dim AudioSessionId As Int = R.RunMethod("getAudioSessionId")
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
B4X:
Dim jo As JavaObject = player1   
       Dim AudioEventListener As Object = jo.CreateEventFromUI("com.google.android.exoplayer2.audio.AudioRendererEventListener", "AudioEvent", Null)
       jo.GetFieldJO("player").RunMethod("setAudioDebugListener", Array(AudioEventListener))

Sub AudioEvent_Event (MethodName As String, Args() As Object) As Object
   Log(MethodName)
   If MethodName = "onAudioSessionId" Then
       Dim id As Int = Args(0)
       Log("session id: " & id)
   End If
   Return Null
End Sub
 
Upvote 0

Blueforcer

Well-Known Member
Licensed User
Longtime User
Seems like it doesnt work with the current version of ExoPlayer
java.lang.RuntimeException: Method: setAudioDebugListener not found in: com.google.android.exoplayer2.SimpleExoPlayer

i tried
B4X:
Dim jo As JavaObject = B4XPages.MainPage.radio.Player
    Dim AudioEventListener As Object = jo.CreateEventFromUI("com.google.android.exoplayer2.analytics.AnalyticsListener", "AudioEvent", Null)
    jo.GetFieldJO("player").RunMethod("addAnalyticsListener", Array(AudioEventListener))

Buit this gives me no session id but lots of other stuff


is there a new way to get AudioSessionId ?
 
Last edited:
Upvote 0
Top