0

Sorry if this is a possible duplicate, but i have tried a lot of the possible solutions.

Im creating speech recognition app that uses STT and TTS in Android that uses a Bluetooth headset, What its suppose to do is take commands using the headset, but wont , but when i use the mic on the android phone to enter commands .The command can be played back through the headset speaker.

My Manifest file;

<uses-permission android:name="android.permission.READ_PHONE_STATE">
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN">
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"/>
<uses-permission android:name="android.permission.BLUETOOTH"/>

The code below is invoked when a button on the phone it clicked

audioM.setMode(audioM.MODE_IN_COMMUNICATION);
audioM.setBluetoothScoOn(true);
audioM.startBluetoothSco();
audioM.setSpeakerphoneOn(false)

This code successfully plays the command back through the headset.

I have tried using the same AudioManager code, when speaking a command. I have set up a sound clip to play just before the Speech Rec is about to begin. This sound successfully plays through the headset, But i cant speak through the headset(Name:Jabra Supreme) .

I have followed This post without success. And several others, with snippets of code

I am using this speech rec

My android device version 4.4.2 . Android Studio version 1.2.2.

Could it possibly be the headset that is causing the problem? I ask this because when i press the button on the headset , a built in voice plays asking for a command.

Many Thanks

Community
  • 1
  • 1
AndroidAL
  • 1,111
  • 4
  • 15
  • 35
  • possible duplicate of [Using the Android RecognizerIntent with a bluetooth headset](http://stackoverflow.com/questions/14991158/using-the-android-recognizerintent-with-a-bluetooth-headset) – Nikolay Shmyrev Jul 25 '15 at 08:02
  • `startBluetoothSco()` allows you to record using bluetooth headset instead of internal microphone. But if you're not using Android speech recognition,you still have to RECORD the audio yourself and send it to Nuance. You also need `android.permission.RECORD_AUDIO` permission.The button on the headset is completly independent, this is headset built-in speech-recognition. – Florent Jul 25 '15 at 15:54
  • @Florent,Do you mean using the Built in android.speech(Recognizer Intent etc)?. What i am doing is following this [link](http://stackoverflow.com/questions/28450355/how-to-record-audio-from-bluetooth-headset-startbluetoothsco) atm . – AndroidAL Jul 27 '15 at 11:13
  • @AndroidAL yes if you're not using built-in android.speech.* and recording audio yourself, then the link you provide is relevant. Beware that the android bluetooth stack is far from being bug-free and it can depend on android version, device... I have never made it work on my Nexus 7. If you think your code is correct, you should try on another device or check with a bluetooth recording application on the play store. – Florent Jul 28 '15 at 12:59
  • @AndroidAL : Actually, I just found out that allowing bluetooth recording is a setting in google settings, section "Voice", you should have a look – Florent Aug 03 '15 at 08:53

0 Answers0