iOS8 AVAudioSession setActive error

后端 未结 5 1111
独厮守ぢ
独厮守ぢ 2020-12-28 12:00

I\'m testing my app in XCode 6 and find an issue with AVAudioSession in iOS8.

When I call

[[AVAudioSession sharedInstance] setActive:NO error

5条回答
  •  情歌与酒
    2020-12-28 13:02

    I solved this problem, inserting this code in the method of AVAudioPlayerDelegate.

    -(void)audioPlayerDidFinishPlaying:(AVAudioPlayer *)player successfully:(BOOL)flag{
      [audioPlayer stop];
      [audioPlayer prepareToPlay];
    }
    

    where audioPlayer is a variable declared in the header of my class.

    the instruction prepareToPlay should resolve your problem!

提交回复
热议问题