How to get AVAudioPlayer output to the speaker

前端 未结 10 1725
孤城傲影
孤城傲影 2020-12-07 14:29

I\'m recording audio with AVAudioRecorder as seen in How do I record audio on iPhone with AVAudioRecorder?

I then use AVAudioPlayer to play back the recording. Howev

10条回答
  •  一个人的身影
    2020-12-07 15:26

    Swift2:

    try session.setCategory(AVAudioSessionCategoryPlayAndRecord,
        withOptions:AVAudioSessionCategoryOptions.DefaultToSpeaker)
    

提交回复
热议问题