Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

startVoiceRecognition with bluetooth headset is not working

I need to use bluetooth headset with voice recognition, which almost works fine in some devices like S3, S4 and Samsung Grand. However, when I tried same on Nexus 7, I am getting

BluetoothHeadsetServiceJni : Failed to start voice recognition, status: 6

error when I am calling startVoiceRecognition() method. I am using the code from this SO page.

What are the possible reasons for this issue occur only in some devices? Is there any way to solve this issue?

like image 546
Narayan soni Avatar asked Sep 04 '14 13:09

Narayan soni


2 Answers

Using shoe rat suggestion, modify the start method in the link and see if it will work.

public boolean start()
{
    if (!mIsStarted)
    {
        mIsStarted = true;
        if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB || "Nexus 7".equals(Build.MODEL)
        {
            mIsStarted = startBluetooth();
        }
        else
        {
            mIsStarted = startBluetooth11();
        }
    }

    return mIsStarted;
}
like image 52
Hoan Nguyen Avatar answered Oct 22 '22 05:10

Hoan Nguyen


I have been check as Narayan mentioned, I found BluetoothHeadset.STATE_AUDIO_CONNECTED does fire in nexus 7 as well some other ZTE devices, may be this is manufature fault or a that device does not support call and you are try to communicate via call_mode, I think there is only workaround to solve this issue

like image 28
Aman Avatar answered Oct 22 '22 06:10

Aman