我正在尝试使用此代码在惊人的音频引擎的帮助下实现在线流/缓冲,但它引发了以下错误:
AEAudioFilePlayer.m:148: AudioFileOpenURL: 'wht?' (2003334207)
这是代码:
- (void)viewDidLoad {
[super viewDidLoad];
self.audioController = [[AEAudioController alloc] initWithAudioDescription:[AEAudioController nonInterleaved16BitStereoAudioDescription] inputEnabled:YES];
_audioController.preferredBufferDuration = 0.005;
[_audioController start:NULL];
[self initWithAudioController:self.audioController];
AEAudioFilePlayer *oneshot = [AEAudioFilePlayer audioFilePlayerWithURL:[NSURL URLWithString:self.urlOfSong] error:NULL];
_oneshot.removeUponFinish = YES;
[_audioController addChannels:[NSArray arrayWithObject:oneshot]];
}
- (id)initWithAudioController:(AEAudioController*)audioController {
self.audioController = audioController;
NSError *error = NULL;
BOOL result = [self.audioController start:&error];
if ( !result ) {
// Report error
NSLog(@"The Amazing Audio Engine didn't start!");
} else {
NSLog(@"The Amazing Audio Engine started perfectly!");
}
return self;
}