bluetooth-sco

How to Text-to-Speech plays on Bluetooth in Android?

杀马特。学长 韩版系。学妹 提交于 2021-02-19 05:24:22
问题 I'm a newbie for android. I've created an app that can read Incoming messages using Android Text-To-Speech. Up to now its fine with it. Now user's want It has to play over paired Bluetooth. I'd read all the forums but i didn't get it. Now how i play my TTS engine on Bluetooth ? Anyone having any idea ? Thanks in advance. 回答1: Use my answer at Using the Android RecognizerIntent with a bluetooth headset And create a speak method like below protected void speak(String text) { HashMap<String,

Bluetooth connectivity: MODE_IN_CALL vs MODE_IN_COMMUNICATION

橙三吉。 提交于 2021-01-27 12:23:02
问题 I have an application that needs to connect to wireless bluetooth headset to collection RAW audio. MODE_IN_CALL works in some devices and MODE_IN_COMMUNICATION in others. Mic works and I lose audio or vice versa. I am using Nexus 5x and Samsung Edge. But behaviour is inconsistent across 2 devices of same model and make. Phone calls and Media Audio is enabled for paired bluetooth headset. if (btAdapter != null && btAdapter.isEnabled() && btAdapter.getProfileConnectionState(BluetoothProfile

How to initiate a call from HF through AG via Handfree Audio Gateway in Android?

╄→гoц情女王★ 提交于 2019-12-25 03:13:06
问题 So far I have been able to initiate a call from the AG (Audio Gateway) which is an Android phone through bluetooth connection from the phone in which my app is loaded (the HF or Hands-free), to the target phone. I have used this code for this procedure: /////////////////////////////////////////////////////////////////////////////// //Here, how to establish voice connectivity from AG to my phone(HF)? ////////////////////////////////////////////////////////////////////////////// // Calling the

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

Capture Audio through Bluetooth Headset paired with Android Device

旧时模样 提交于 2019-12-06 16:46:27
问题 I am trying to capture audio from a Bluetooth Headset paired with an Android Device. Following is the relevant code: Intent in=null; final int bufferSize=BufferElements2Rec*BytesPerElement; final BroadcastReceiver brr=new BroadcastReceiver() { @Override public void onReceive(Context context,Intent intent) { int state=intent.getIntExtra(AudioManager.EXTRA_SCO_AUDIO_STATE,-1); Log.d(labelApp,"Audio SCO State = "+state); if(AudioManager.SCO_AUDIO_STATE_CONNECTED==state) { Log.d(labelApp,"Entered

startVoiceRecognition with bluetooth headset is not working

偶尔善良 提交于 2019-12-05 03:09:51
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? I have been check as Narayan mentioned, I found BluetoothHeadset.STATE_AUDIO_CONNECTED does fire in nexus 7 as well some other ZTE devices,

How to record audio from bluetooth headset (startBluetoothSco() )

荒凉一梦 提交于 2019-12-03 09:50:01
问题 I am trying to record audio from bluetooth headset, startBluetoothSco() works different in different versions of android, Recording audio from bluetooth headset on android 4.2, 4.4, and 5.0. using " Nokia BH-310 and 9xxPlantronics " bluetooth headsets. SAMPLE_RATE = 8000; Devices running Android 4.2 records audio from bluetooth device only when when AudioRecord() object is created like this AudioSource.DEFAULT mRecorder = new AudioRecord(MediaRecorder.AudioSource.DEFAULT, SAMPLE_RATE,

How to get bluetooth connected devices using BluetoothHeadset API

我们两清 提交于 2019-11-27 04:39:43
I want to get list of bluetooth connected devices...not just paired devices. I found BluetoothHeadset API in API level 11 which provides method getConnectedDevices() to get list of connected bluetooth devices. How to get list of bluetooth connected devices using this API ? Priyank Patel Finally got the solution. Below are a few code snippets for getting Bluetooth audio connected devices using BluetoothHeadset API. BluetoothHeadset mBluetoothHeadset; // Get the default adapter BluetoothAdapter mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter(); // Establish connection to the proxy.

How to get bluetooth connected devices using BluetoothHeadset API

橙三吉。 提交于 2019-11-26 11:18:00
问题 I want to get list of bluetooth connected devices...not just paired devices. I found BluetoothHeadset API in API level 11 which provides method getConnectedDevices() to get list of connected bluetooth devices. How to get list of bluetooth connected devices using this API ? 回答1: Finally got the solution. Below are a few code snippets for getting Bluetooth audio connected devices using BluetoothHeadset API. BluetoothHeadset mBluetoothHeadset; // Get the default adapter BluetoothAdapter