简体   繁体   English

如何在iPhone上使用A2DP连接到远程设备

[英]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: 所以我的问题是:

  • 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? 我熟悉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.

相关问题 如何以编程方式扫描并连接到iOS上的Bluetooth A2DP设备 - How to scan and connect to Bluetooth A2DP device on iOS programmatically 是否可以将十六进制数据快速发送到 A2DP 蓝牙设备? - Is possible send hexadecimal data to A2DP Bluetooth Device in swift? AVAudioSession 不会自动连接蓝牙 A2DP 音频? - AVAudioSession does not automatically connect to Bluetooth A2DP audio? 如何检测 iOS 中是否连接了 HFP 或 A2DP? - How can I detect whether an HFP or A2DP is connected in iOS? 如何使用蓝牙4.0(BLE)如何使A2DP蓝牙配置文件工作? 我需要AptX编解码器吗? - How are you able to get an A2DP bluetooth profile to work using bluetooth 4.0 (BLE)? Do I need an AptX codec? 如何将iPhone连接到蓝牙设备? - How to connect iPhone to Bluetooth device? 如何将iPhone与外部设备连接? - How to Connect iPhone with external device? iOS蓝牙双模; 同时将BLE(GATT)连接到已连接的BR / EDR(A2DP / HFP)立体声耳机 - iOS Bluetooth dual-mode; connect BLE (GATT) to an already connected BR/EDR (A2DP/HFP) stereo headset simultaneously iOS上的蓝牙A2DP API支持? - Bluetooth A2DP API Support on iOS? 如何将 iphone/ipad 连接到远程 MSSQLSERVER 数据库? - How to connect iphone/ipad with a remote MSSQLSERVER database?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM