2

AVAudioPlayer getting error like this:

The operation couldn’t be completed. (OSStatus error 1954115647.)

I download audio mp3 file from some url using NSURLConnection and it is downloading 100% and save to DB as BLOB.

And then I am trying to play that file from AVAudioPlayer like this:

AVAudioPlayer *player = [[AVAudioPlayer alloc] initWithData:data error:&error];
if (player == nil) 
{
    NSLog(@"AudioPlayer did not load properly: %@", [error localizedDescription]);
} 
else
{
    [player play];
}

What I am doing wrong in this?

Hash
  • 4,647
  • 5
  • 21
  • 39
Dilip Lilaramani
  • 1,126
  • 13
  • 28
  • See http://stackoverflow.com/questions/4901709/iphone-avaudioplayer-unsupported-file-type – Till Nov 08 '11 at 12:53

1 Answers1

0

Did you try using initializing AVAudioPlay with URL and pointing the URL to the blob file ?

(id)initWithContentsOfURL:(NSURL *)url error:(NSError **)outError

It worked for me with the local URL setting.

oers
  • 18,436
  • 13
  • 66
  • 75
Samuel Sharaf
  • 1,237
  • 1
  • 8
  • 6