Android Question Send audio phone call to bluetooth HC-05

CanguroCode

Active Member
Licensed User
Longtime User
Hi, I have a project. I need to send the audio from a phone call to bluetooth module HC-05, but i don't know how routing the audio streaming from the phone call. Anyone knows how? (i know is easy with a freehands bluetooth but i need to process the data audio in this way).

Thanks!

PD.- I found this posts:

https://www.b4x.com/android/forum/t...udio-to-bluetooth-or-phone.37081/#post-292682
https://www.b4x.com/android/forum/threads/call-recording-automatically.45094/#content
https://www.b4x.com/android/forum/threads/audio-library-v1-5-new-audiostreamer-object.30550/#content
 
Last edited:

CanguroCode

Active Member
Licensed User
Longtime User
I see... but this is posible?=
https://www.b4x.com/android/forum/threads/routing-calls-audio-to-bluetooth-or-phone.37081/#content

Because its something like that right? i don't know whats mean this?

B4X:
Dim r As Reflector
r.Target = r.GetContext
r.Target = r.RunMethod2("getSystemService", "audio", "java.lang.String")
Dim mode As Boolean
mode=True
r.RunMethod2("setSpeakerphoneOn", mode, "java.lang.boolean")
DoEvents
mode=False
r.RunMethod2("setSpeakerphoneOn", mode, "java.lang.boolean")

BTW I changed the bluetooth device class actually the android device recognize the HC05 like a hands free but I can't conect in that way, so I thing must be a comunication protocol or something, so i can send bytes, but i dont found how send the data audio my idea is something like this:


B4X:
Sub Process_Globals
    Dim a As AudioStreamer
End Sub

Sub Globals
    a.Initialize2(4, "a", 4400, True,16, a.VOLUME_MUSIC)
End Sub

Sub Activity_Create(FirstTime As Boolean)
    Activity.LoadLayout("Principal")
    a.StartRecording
    SendToBluetooth 'just an idea i still dont kwo how send to bluetooth
  
End Sub

But that produce an initialization error so, why Google gives the acces to the audio streaming but prduce an error? any idea?

Edit: I want try something like this:
https://www.b4x.com/android/forum/threads/voice-recognition-via-bluetooth-headset.44629/#post-272597
 
Last edited:
Upvote 0
Top