【发布时间】:2016-01-27 10:04:39
【问题描述】:
我正在尝试使用此代码在惊人的音频引擎的帮助下实现在线流式传输/缓冲,但它引发了以下错误:
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;
}
【问题讨论】:
-
它在 iOS 9 上吗?你有那个done 吗?
-
yes 允许任意加载,并且在 iOS 9 上确实有效
标签: ios audio audio-streaming the-amazing-audio-engine