I want to connect to a Bluetooth device and have my app send to it audio over A2DP.
So my question is:
How to scan for a bluetooth device?
How to pair with it ?
How to send audio to the paired device?
I am familiar with Corebluetooth but its not compatible for Bluetooth that is not low energy, so what framework should i use?
Should the user connect the device throw the settings of the app or can my deal with that?
I know there is a lot of questions but all the information that i found was for android.
Thank you!
Hi let me answer your questions one by one
first of all you dont use CoreBluetooth
you will use AVFoundation and/or CoreAudio (which is a really huge framework with AudioUnits and AudioQueue and much more)
BUT if you just want to play Audio you may not need to dive into CoreAudio
AVFoundation is built on CoreAudio and can easily play and record from Bluetooth devices
How to send audio to the paired device?
Core Audio and AVFoundations both have mechanism for getting and sending audio to Bluetooth Audio devices from/to your iphone
How to scan for a bluetooth device and How to pair with it ?
this is done via Bluetooth Settings in your iphone.you just trun yout BT Speaker ON and search then you Pair it for future use
hope this helps
Related
I want to make an app to find the lost Bluetooth device (like Airpod). The idea is the same as Wunderfind.
With CoreBluetooth, I can display nearby Bluetooth devices with signal strength and distance. But I don't know how to play a sound/audio on these devices (to help the user to find it easily).
How to do this?
Unfortunately there isn't a direct way to do this with CoreBluetooth. LE Audio was just announced last month (6/7 Jan 2020) and it will take a few months or maybe even years for devices to begin supporting this. CoreBluetooth does not support transferring audio of any kind so your next best solution is to transfer normal BLE GATT packets, and then have the receiving device play some audio on reception of that specific sequence of packets. This means that your solution will be device specific and you'll have to work on the app side (on the iOS device) and the remote device that is playing the audio.
Some references for this:-
CoreBluetooth and audio stream
how to find Bluetooth audio devices in iOS
What profile can I use with CoreBluetooth?
What is LE Audio
Bluetooth Low Energy: A Primer
I am working on the iOS app to control music player over Bluetooth LE. I have BLE enabled peripheral device (Wearable Watch) and it will act as a music remote controller. I came to know that AVRCP profile is the option provided by iOS to control music on iPhone, but this profile is based on classic Bluetooth profile(Not on BLE).
Edited:
Is there any way for controlling Music player using iOS BLE service?
Can Please provide me the suggestion to control music player (Play, Pause, Next and Previous) on iPhone using BLE service?
I was refer this links
What specs do I need to know to develop bluetooth (AVRCP 1.4) iPhone app
iOS Bluetooth dual-mode; connect BLE (GATT) to an already connected BR/EDR (A2DP/HFP) stereo headset simultaneously
What profile can I use with CoreBluetooth?
Please help me out.
Thanks in Advance.
AVRCP is a BR/EDR profile. It is not available on LE. LE only accepts the items listed in the GATT-Based Specifications part of adopted specifications page.
You could implement a HID profile (used for input devices) on your device, then you may send key presses for Play/Pause, Next, Previous, Volume up/down, Mute, etc.. Most multimedia keys work as expected.
Since the question was only about iOS the correct answer is to use Apple's proprietary GATT protocol, which has been developed already in 2014.
The Apple Media Service (AMS) is used with Bluetooth accessories that connect to iOS devices through Bluetooth low-energy links. It gives them a simple and convenient way to control media apps and access information about the media states of the connected iOS devices.
https://developer.apple.com/library/archive/documentation/CoreBluetooth/Reference/AppleMediaService_Reference/Introduction/Introduction.html
I'm developing an app that plays and records, I wonder if it is possible to use a Bluetooth device with the AVAudioSessionCategoryMultiRoute, and if the answer is Yes, How to record from two devices like the iPhone built-in microphone and a Bluetooth microphone? because I couldn't find any tutorial or example to do this.
I’ve been reading that BLE only works with a small amount of profiles (based on GATT and other smaller use specific profiles), but I’ve seen many Bluetooth 4.0 headphones that use A2DP available on the market (examples below). However, all of the bluetooth 4.0 headphones have one thing in common…use of the aptX codec. What is aptX and is it way to get A2DP to work as a profile using bluetooth 4.0? Is there another way anyone knows about to pass audio and remote control commands to a mobile device over BLE?
Example 1
Example 2
BLE will not support A2DP. from the specifications provided on the link, these devices are dual mode(supports both BT Classic and BT LE).APTx is a codec and provides better sound quality than SBC but SBC is mandatory to support in A2DP profile.
I want to transfer some data from an embedded device to an iOS device using Bluetooth.
I am well aware that this is not possible using regular bluetooth serial communication as iOS devices does not implement any API to do this.
Here is what I collected from my researches :
iOS devices support the following BT profiles (HFP,PBAP,A2DP,AVRCP,PAN,HID,MAP)
=> http://support.apple.com/kb/ht3647
iOS most recent devices support Bluetooth Low Enery (Bluetooth Smart ready) devices although it is low rate transfer.
iOS does NOT support data transfer using Bluetooth.
My questions is whether it is possible (or not) to use a bluetooth module within the range of accepted profiles in order to transfer data.
The idea would be the following :
Is this possible ?
Basically, the question is even simpler. Is it possible to record an audio stream coming from a bluetooth headset and save this stream to a file ?