My Problem is the following. I got this code and i guess a corrupt NSURL since the AVAudioPlayer is nil after initializing:
NSString *dummyURLString = @"http://a825.phobos.apple.com/us/r2000/005/Music/d8/a8/d2/mzi.jelhjoev.aac.p.m4p";
NSError *error;
NSURL *url = [NSURL URLWithString:dummyURLString];
AVAudioPlayer *player = [[AVAudioPlayer alloc] initWithContentsOfURL:url error:&error];
[player play];
Any suggestions what is going wrong here?
The &error shows this:
Error Domain=NSOSStatusErrorDomain Code=-43 "Operation could not be completed. (OSStatus error -43.)"
Instead of using the AVAudioPlayer you can use the AVPlayer. The AVPlayer works as well with remote URLs
I tried this first but got error 2003334207:
Seems that AVAudioPlayer really wants a file. So I put the data into a file first:
AVAudioPlayer only works with local URL's. It must be a File URL (file://)
See Apple's Technical Q&A QA1634