在ios6上运行非常正常的AVAudioRecoder组件,而跑到ios7上就不能工作了。通过google搜索在stackoverflow上的解决方法。http://stackoverflow.com/questions/18922053/avaudiorecorder-avaudioplayer-with-ios-7-not-working-properly

解决方法只需要在使用AVAudioRecoder之前,添加如下代码:

AVAudioSession *audioSession = [AVAudioSession sharedInstance];

 [audioSession setCategory:AVAudioSessionCategoryPlayAndRecord error:nil];

 [audioSession setActive:YES error:nil];

这样就可以在ios7下正常运行了。

 

相关文章:

  • 2021-06-18
  • 2022-12-23
  • 2021-10-09
  • 2022-12-23
  • 2021-09-03
  • 2022-12-23
  • 2021-07-06
  • 2021-06-07
猜你喜欢
  • 2021-12-27
  • 2022-12-23
  • 2022-12-23
  • 2021-07-18
  • 2022-12-23
  • 2022-01-20
相关资源
相似解决方案