a2dp

In Android, is there any way to route the audio to A2DP using “MODE_IN_COMMUNICATION”?

走远了吗. 提交于 2021-02-08 10:28:09
问题 If I set AudioManager mode to MODE_IN_COMMUNICATION, and set the Media Player stream to STREAM_VOICE_CALL, I can route the audio to the speakerphone or the internal handset speaker just fine. And if it's routed to the internal speaker, and a wired headset is plugged int, it automatically routes to it. However, I can't figure out a way to route the audio to an A2DP headset (without changing the audio mode to MODE_NORMAL, or the stream to STREAM_MUSIC). My problem is that using MODE_NORMAL and

In Android, is there any way to route the audio to A2DP using “MODE_IN_COMMUNICATION”?

浪子不回头ぞ 提交于 2021-02-08 10:27:24
问题 If I set AudioManager mode to MODE_IN_COMMUNICATION, and set the Media Player stream to STREAM_VOICE_CALL, I can route the audio to the speakerphone or the internal handset speaker just fine. And if it's routed to the internal speaker, and a wired headset is plugged int, it automatically routes to it. However, I can't figure out a way to route the audio to an A2DP headset (without changing the audio mode to MODE_NORMAL, or the stream to STREAM_MUSIC). My problem is that using MODE_NORMAL and

How can I detect whether an HFP or A2DP is connected in iOS?

ぐ巨炮叔叔 提交于 2020-08-07 08:03:51
问题 I am working on a project which can play music via HFP device. But here's a problem that I want to detect whether an HFP or A2DP is connected when music is playing. Now I am using the AVFoundation framework to do this. Here's the code: - (BOOL)isConnectedToBluetoothPeripheral { BOOL isMatch = NO; NSString* categoryString = [AVAudioSession sharedInstance].category; AVAudioSessionCategoryOptions categoryOptions = [AVAudioSession sharedInstance].categoryOptions; if ((![categoryString

Bluez 5 - initiate avrcp connection to iPhone from Bluez

徘徊边缘 提交于 2020-01-23 02:55:31
问题 Bluez 5.28 Goal - Control iOS track skip, and initiate connection from Bluez programmatically. Do not want a2dp. Everything works fine if I initiate connection from iPhone/iPad (go to BT settings, click on Pi device), which I want to avoid and not have to fiddle with the phone. (car setup with Pi). I have control, track metadata, etc. Doing a connect xx:xx:xx:xx:xx:xx in bluetoothctl yields: a2dp-source profile connect failed for 6C:70:9F:7E:EF:A8: Protocol not available Ok. It needs

Toggling A2DP Device (Android)

此生再无相见时 提交于 2020-01-12 07:10:34
问题 I have two paired bluetooth devices (my car's head-unit for phone audio and a separate bluetooth receiver for A2DP). On my phone there's a checkbox for "Use for media audio" that I have to manually toggle for my A2DP output to go to my car's speakers. My goal is to toggle this programmatically. I tried using both the AudioManager class with the deprecated setBluetoothA2dpOn and the setBluetoothScoOn but neither seemed to have any effect. I was able to get a list of the bluetooth paired

Linux BlueZ dbus communication a2dp

你。 提交于 2019-12-24 16:19:24
问题 As a quick summary I'm currently building a Raspberry Pi with the ability to act as a Bluetooth A2DP Receiver and routing that audio to a 3.5mm connection. One of the Python scripts I run uses BlueZ and Dbus to communicate with the bluetooth device, At the moment the script I'm using finds a BT device thats been paired with the system before and auto connects to it (Script runs on cron), I can then press Play on my iPhone to start the audio streaming.. However what I am trying to do is once

What's the difference among AVAudioSessionPortBluetoothHFP, A2DP and LE?

老子叫甜甜 提交于 2019-12-21 02:03:30
问题 There are three different Bluetooth related audio port types documented in Apple's AVAudioSessionPortDescription reference. But Apple doesn't explain much about these three types. Can somebody help explain more? 回答1: AVAudioSessionPortBluetoothHFP | Input and Output This is used when connected to a bluetooth devices through Hands-Free profile, like cars or earpieces. It can be accessed by setting your audio session category to AVAudioSessionCategoryPlayAndRecord and category option

Cant receive AT Commands from Bluetooth Headset

无人久伴 提交于 2019-12-10 20:22:07
问题 I am trying to receive AT command broadcast from a Bluetooth headset ( samsung made) , it connects just fine , but code below isn't giving anything , what is that I am missing here ? I am basically trying to get battery level of headset Any pointers will be a great help. This is how I am registering the receiver. val intentFilter = IntentFilter() intentFilter.addAction(BluetoothHeadset.ACTION_VENDOR_SPECIFIC_HEADSET_EVENT) intentFilter.addCategory(BluetoothHeadset.VENDOR_SPECIFIC_HEADSET

Is possible send hexadecimal data to A2DP Bluetooth Device in swift?

北城余情 提交于 2019-12-08 09:35:22
问题 I am developing an application on iOS that connects to a Bluetooth A2DP device but I can not send instructions in hexadecimal to make it work. Somebody could help me? I can not find information. With AVAudioSession.sharedInstance().currentRoute I can see the UID and the name of the device but not send data. let route = AVAudioSession.sharedInstance().currentRoute let outPort = route.outputs.first if let outPort = outPort { print("out port name:\(outPort.portName)") } Could you help me? Thanks

How to set a2dp sink as a default (android 7.1)

依然范特西╮ 提交于 2019-12-08 05:16:09
问题 We made a custom board which has Android 7.1 operating system as a our custom board must act to a reciver with bluetooth(while a2dp sink profile in bluetooth can do this), but we have do many works over weeks on it , but it still not work, so i'd like to ask somebody who know or had similar expirence on it could help. Android 7.1 used the fluoride Bluetooth stack our works : 1. packages/apps/Bluetooth/res/values/config.xml <bool name="profile_supported_a2dp">true</bool> <bool name="profile