startVoiceRecognition with bluetooth headset is not working

喜欢而已 提交于 2019-12-22 03:48:25

问题


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?


回答1:


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




回答2:


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;
}



回答3:


Nexus 7 does not support VoiceRecognition,becuase Nexus 7 does not support Bluetooth HFP(handsfreee profile) who contains VoiceRecognition. You can find device Bluetooth info in https://www.bluetooth.org/tpg/listings.cfm.



来源:https://stackoverflow.com/questions/25667294/startvoicerecognition-with-bluetooth-headset-is-not-working

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!