Android Question Bluetooth headset sco problem

brelto85

Active Member
Licensed User
Longtime User
Hi all,

I've a serious problem with bluetooth headset's management
In my app, i've added a functionality that if the user, long press HOME button (ASSIST intent), run my app and start the voice recognition
If the bluetooth headset is connected, the voice recognition sound is redirected into bluetooth device using the starBluetoothSco() method (AudioManager native library)

this works perfectly!

After which i added another intent (VOICE_COMMAND) that fired if starts a voice command with bluetooth headset (long press button of device)

In this case the method starBluetoothSco() doesn't work and the audio not heard in the headset

i've attached a test project that simulates the behaviour
can you help me?
This failure prevents the publication of my app on the store

Alberto
 

Attachments

  • TestVoiceCommand.zip
    7.2 KB · Views: 540

brelto85

Active Member
Licensed User
Longtime User
this is the problem..

After which i added another intent (VOICE_COMMAND) that fired if starts a voice command with bluetooth headset (long press button of device)
In this case the method starBluetoothSco() doesn't work and the audio not heard in the headset

the bluetooth is already connected, but after long press of bluetooth headset, start my app (with intent VOICE_COMMAND) and doesn't work method starBluetoothSco()
the unfiltered logs doesn't work after the updated at windows 8.1 (deploy through B4A bridge)
probably problem with driver usb
 
Upvote 0

brelto85

Active Member
Licensed User
Longtime User
yes

after other test i solved it putting a custom wait method after long press
probably the cause is that after long click the BT button, is not ready to start the sco

would be appropriate to intercept an intent that indicates the time at which it is possible to start the sco
 
Upvote 0

Al Evans

Member
Licensed User
Longtime User
Hi Brelto85,

Would you be good enough to share the code you have that is now working please? I'm trying to do the same thing with a BT Headset....

Many thanks

Alan
 
Upvote 0
Top