英文:
While recording in background, audio playback quality loss when using Carplay
问题
我们的应用程序使用playAndRecord
类别,选项包括interruptSpokenAudioAndMixWithOthers
、allowBluetoothA2DP
、allowAirPlay
和defaultToSpeaker
,并且在后台运行时,Spotify或其他音乐应用程序在iPhone未连接到任何设备或连接到蓝牙时可以正常播放。但是,一旦iPhone通过蓝牙或USB电缆连接到CarPlay,音乐应用程序的播放质量变得平淡,这表明录音正在使用Hands Free Profile(如果设置为allowBluetooth
并连接到蓝牙设备,也会发生这种情况) - 是否有任何方法可以在连接到CarPlay时继续使用iPhone麦克风进行录制,以便我们可以允许音乐应用程序正常播放?
英文:
Our app uses playAndRecord
category with options of interruptSpokenAudioAndMixWithOthers
, allowBluetoothA2DP
, allowAirPlay
& defaultToSpeaker
, and while backgrounded, Spotify or other music apps play normally when the iPhone is not connected to anything or is connected to Bluetooth. However, once iPhone is connected to CarPlay either via Bluetooth or via USB cable, the music apps' playback quality become flat which suggests the recording is using the Hands Free Profile (which would also happen if allowBluetooth
is set and connected to Bluetooth devices) - is there any way to keep using the iPhone microphone to record while connected to CarPlay so that we can allow music apps to play normally?
答案1
得分: 1
首先,playAndRecord
和 allowBluetoothA2DP
是矛盾的。A2DP 无法录音。另外,我不清楚为什么您要同时包含 defaultToSpeaker
和任何 allow...
选项。您是想播放到扬声器还是不是?
音质差是因为 HFP。我认为这在很大程度上是 https://stackoverflow.com/questions/68730069/ios-app-bluetooth-audio-coming-out-in-phone-mode/68733546?noredirect=1#comment134416010_68733546 的重复,并且那里的答案适用。要么使用 A2DP 并使用手机的麦克风(而不是汽车的),要么使用 HFP 并且音质差。CarPlay 并不特别影响这一点。
如果您控制汽车音频系统,那么您可以创建一个独立的音频通道连接到手机。这通常是我在处理耳机时所做的事情。我们创建了一个自定义音频编码,并通过 iAP2 进行了流传输。但是您必须控制设备的固件才能实现这一点。标准协议不允许这样做。
英文:
First, playAndRecord
and allowBluetoothA2DP
are contradictory. A2DP cannot record. Also, I'm unclear why you would include both defaultToSpeaker
and any of the allow...
options. Do you want to play to the speaker or not?
The poor audio quality is precisely due to HFP. I believe this is mostly a duplicate of https://stackoverflow.com/questions/68730069/ios-app-bluetooth-audio-coming-out-in-phone-mode/68733546?noredirect=1#comment134416010_68733546, and the answers there apply. Either use A2DP and the phone's microphone (rather than the car's), or use HFP and have poor audio quality. CarPlay doesn't particularly factor into this.
If you control the car audio system, then you can create your own independent audio channel to the phone. This is what I've generally done when working on earbuds. We created a custom audio encoding, and streamed it over iAP2. But you have to control the firmware of the device to do this. The standard protocols don't allow it.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论