Reputation: 6654
I am using voice recognition in my activity and I just realized that if I have a headset connected, the recognizer still only listens through the phone mic. Is there any way to make it listen through the headset?
I did notice this: http://developer.android.com/reference/android/bluetooth/BluetoothHeadset.html but most of the methods are not available until HoneyComb ...
Thanks.
Upvotes: 3
Views: 4829
Reputation: 2674
You can use:
audioManager.startBluetoothSco();
Make sure the following are added to your manifest:
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"/>
Upvotes: 2
Reputation: 6654
Basically, this can only be done using the BluetoothHeadset class...
In my voice recognition activity, I call this method first: startVoiceRecognition() then proceed as normal.
When I am done, I then call stopVoiceRecognition(). It actually appears to work nicely.
Only issue is that it doesn't work on API levels <11 ...
Upvotes: 2