[英]How to connect to a remote device using A2DP on iPhone
I want to connect to a Bluetooth device and have my app send to it audio over A2DP. 我想连接到蓝牙设备,并让我的应用通过A2DP向其发送音频。 So my question is:
所以我的问题是:
I am familiar with Corebluetooth
but its not compatible for Bluetooth that is not low energy, so what framework should i use? 我熟悉
Corebluetooth
但它与Corebluetooth
的Bluetooth不兼容,那么我应该使用什么框架? 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. 我知道这里有很多问题,但是我发现的所有信息都是针对Android的。
Thank you! 谢谢!
Hi let me answer your questions one by one 嗨,我来一个接一个地回答你的问题
first of all you dont use CoreBluetooth 首先,您不使用CoreBluetooth
you will use AVFoundation and/or CoreAudio (which is a really huge framework with AudioUnits and AudioQueue and much more) 您将使用AVFoundation和/或CoreAudio (这是一个非常庞大的框架,其中包含AudioUnits和AudioQueue等)
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 但是,如果您只想播放音频,则可能无需深入学习CoreAudio AVFoundation是基于CoreAudio构建的,可以轻松地从蓝牙设备播放和录制
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 Core Audio和AVFoundations都具有用于从您的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 这是通过iPhone上的蓝牙设置完成的。您只需将BT Speaker打开,然后进行搜索,然后将其配对以备将来使用
hope this helps 希望这可以帮助
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.