iDilip iDilip - 1 year ago 103
Objective-C Question

AVAudioPlayer getting error?

AVAudioPlayer getting error like this:

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

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

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

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

What I am doing wrong in this?

Answer Source

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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download