0
我想從互聯網上獲得一個MP3文件的時間,我用下面的代碼:一個MP3的時間返回零
NSURL *url = [NSURL fileURLWithPath:@"http://view.33591.com:586/2012/11/30/11/4207369.mp3"];
AVURLAsset *asset = [[AVURLAsset alloc] initWithURL:url
options:nil];
CMTime time = asset.duration;
float seconds = CMTimeGetSeconds(time);
NSLog(@"seconds:%f",seconds);
但它總是返回0,如果我改變url到本地文件從捆綁,它工作得很好。所以有辦法做到這一點正確嗎?