4

我正在使用 AVAssetReader 和 iPod 库进行播放,当我将应用程序放在后台时,它会继续将音频读取到播放缓冲区,但是当它到达一首歌曲的结尾并开始阅读下一首歌曲时,它会在 startReading 时失败叫做。我收到以下错误详细信息。

Error Domain=AVFoundationErrorDomain Code=-11800 "The operation couldn’t be completed.  (AVFoundationErrorDomain error -11800.)" UserInfo=0x1bfc20 {NSUnderlyingError=0x113e00 "The operation couldn’t be completed. (OSStatus error -12985.)"}
{
    NSUnderlyingError = "Error Domain=NSOSStatusErrorDomain Code=-12985 \"The operation couldn\U2019t be completed. (OSStatus error -12985.)\"";
}

我不知道对 AVAssetReader 的限制吗?

4

1 回答 1

-1
NSError *sessionError = nil;
    [[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback error:&sessionError];
    UInt32 doSetProperty = 1;
    OSStatus tStatus = AudioSessionSetProperty (kAudioSessionProperty_OverrideCategoryMixWithOthers,
                                                sizeof (doSetProperty),
                                                &doSetProperty
                                                );
    NSLog(@"AVAudioSession AudioSessionSetProperty status is %@", tStatus);
    [[AVAudioSession sharedInstance] setActive:YES error:&sessionError];
    [[AVAudioSession sharedInstance] setDelegate:self];
    NSLog(@"AVAudioSession setActive Error is %@", sessionError);
于 2011-10-13T03:04:57.670 回答