AVAudioSessionCategoryPlayAndRecord with Airplay

后端 未结 4 1401
我在风中等你
我在风中等你 2021-02-03 20:03

My app uses the microphone and outputs audio, so I am setting my Audio Session to the Play and Record Category, but this seems to disable Airplay. If I set the category to Play,

4条回答
  •  爱一瞬间的悲伤
    2021-02-03 20:46

    If you want to change where the audio is going you need to call AudioSessionSetProperty, and pass it the constant specifying where you want the audio to go. These constants are

    kAudioSessionOverrideAudioRoute_None, which specifies that you wish the audio to be routed to the receiver (the airplay if that's where it is going), or

    kAudioSessionOverrideAudioRoute_Speaker, which specifies that audio should be routed to the speaker at the bottom of the phone.

提交回复
热议问题