0 Replies
      Latest reply on Jun 10, 2015 5:11 PM by djfink
      djfink Level 1 Level 1 (0 points)

        Hello!

         

        I am working on an app that plays audio and accepts voice commands simultaniously. When I play audio through bluetooth in my car, the Audio Session for the app uses the Bluetooth HFP ports. This causes the output audio quality to become very poor. If I switch to AVAudioSessionPlayback, the output is on the A2DP port, which sounds great. Ideally I would like to be able to play ouput through A2DP, and accept input through HFP, but I assume this is a limitation of bluetooth, or everything would already work this way to improve sound quality. For my app it would be acceptable to accept input from the phone's microphone, and play the audio through bluetooth, but this also seems impossible as described here: http://stackoverflow.com/questions/22146406/ios-input-mic-output-bluetooth-device.

         

        Any advice on improving playback audio quality when connected to bluetooth while using AVAudioSessionPlayback and record would be greatly appreciated. Has anyone encounted this issue before and had a suitable fix?

         

        Thanks!

        • Re: Bluetooth with AVAudioSessionPlaybackAndRecord
          hotpaw2 Level 2 Level 2 (95 points)

          You could try submitting a enhancement request bug report for this Bluetooth audio capability, but it's very likely a dup, as it's been asked about in the forums here for years.

          • Re: Bluetooth with AVAudioSessionPlaybackAndRecord
            theanalogkid Apple Staff Apple Staff (610 points)

            You are correct in that you cannot currently play out via A2DP while accepting input via HFP. There is a comment in the "Note" section of Q&A1799 "AVAudioSession - Microphone Selection" discussing HFP and AVAudioSessionCategoryPlayAndRecord with respect to the Input case. https://developer.apple.com/library/ios/qa/qa1799/_index.html

             

            It is unfortunate that the document formatting is messed up in that the "Note" box doesn't actually surround all the relevant text, but here's the important bit:

             

            "If an application uses the setPreferredInput:error: method to select a Bluetooth HFP input, the output will automatically be changed to the Bluetooth HFP output. Moreover, selecting a Bluetooth HFP output using the MPVolumeView's route picker will automatically change the input to the Bluetooth HFP input. Therefore both the input and output will always end up on the Bluetooth HFP device even though only the input or output was set individually."

             

            The A2DP route is available to you in AVAudioSessionPlayback but will not be in AVAudioSessionCategoryPlayAndRecord.

             

            Definitely file an enhancement request bug, doesn't matter if it's a duplicate - in fact, the more duplicates the better as this indicates the popularity of the requested feature.