Avaudioplayer Osstatus Error 50
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn error domain=nsosstatuserrordomain code=-50 "(null)" more about Stack Overflow the company Business Learn more about hiring developers or
Query Missing Class Name
posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community osstatus error codes Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up AVAudioPlayer initialization: error code -50 up vote 7 down vote avaudiosession favorite 2 I recently ran into a problem that I couldn't find discussed anywhere on the internet - I was initializing an AVAudioPlayer to play an audio file, and getting the following error: Error Domain=NSOSStatusErrorDomain Code=-50 "Operation could not be completed. (OSStatus error -50.) As it turns out, I had made a mistake creating my NSURL to send to the audio player init method, resulting in the NSURL object being null. Stupid mistake, pretty easy to find when debugging, but I thought I'd list it here just in case someone else does the same thing. iphone cocoa-touch core-audio share|improve this question asked Dec 7 '09 at 18:34 pix0r 21.3k157590 3 And for anyone else wondering why their NSURL object is null, if you are creating your NSURL like this and your filename has spaces in it, you'll need to percent encode: NSString *path = [[NSBundle mainBundle] pathForResource:@"file with spaces.mp3" ofType:@""]; NSString *path = [path stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; NSURL *url = [NSURL URLWithString:path]; –Brynjar Jul 31 '11 at 18:14 awesome comment pointing out the problem with spaces in file name! huge thanks! –codepushr Jul 4 '14 at 15:46 add a comment| 3 Answers 3 active oldest votes up vote 6 down vote accepted “ OSStatus error -50” means paramErr, an old-style Mac error code indicating a bad parameter. share|improve this answer answered Dec 7 '09 at 23:08 Jens Ayton 13.4k32643 add a comment| up vote 7 down vote Regarding the comment from Brynjar: The Apple NSURL Class Reference describing URLWithString states To create NSURL objects for file system paths, use fileURLWithPath:isDirectory: instead. I have found that using URLWithString for fil
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community http://stackoverflow.com/questions/1861989/avaudioplayer-initialization-error-code-50 of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up iOS 5.0 AVAudioPlayer Error loading audio clip: The operation couldn’t be completed. (OSStatus error -50.) up vote 3 down vote favorite 2 So I'm trying to test out the audio player on the iPhone, and http://stackoverflow.com/questions/9021032/ios-5-0-avaudioplayer-error-loading-audio-clip-the-operation-couldn-t-be-comple I went off Troy Brant's iOS book. I have the Core Audio, Core Foundation, AudioToolbox, and AVFoundation frameworks added to my project. The error message I get is in the subject field. I read like 20 pages of Google search results before resorting to asking here! /sigh. Thanks if you can help. Here's my code, pretty much verbatim out of his book: NSString *soundFilePath = [[NSBundle mainBundle] pathForResource:@"Yonah" ofType:@"caf"]; NSLog(@"%@", soundFilePath); NSURL *fileURL = [NSURL URLWithString:soundFilePath]; NSError *error; audioPlayer = [[AVAudioPlayer alloc] initWithContentsOfURL:fileURL error:&error]; if (!error) { audioPlayer.delegate = self; //audioPlayer.numberOfLoops = -1; [audioPlayer play]; } else { NSLog(@"Error loading audio clip: %@", [error localizedDescription]); } EDIT: Holy Shinto. I figured out what it was. I changed NSURL *fileURL = [NSURL URLWithString:soundFilePath]; to NSURL *fileURL = [NSURL fileURLWithPath:soundFilePath]; to the latter and I was getting a weird error, weirder than the one in the subject BUT I googled that and I changed my OS input device from my
воспроизводимые случаях я становлюсь audioPlayerDecodeErrorDidOccur:error: со следующими NSError:Error Domain=NSOSStatusErrorDomain https://groups.google.com/d/topic/wordnik-api/FiAeZ8pY0-o Code=-50 "The operation couldn’t be completed. (OSStatus error -50.)"Это происходит osstatus error в игре, которая также использует OpenAL iphone audio avaudioplayer nserror Найдено 1 ответ: AVAudioPlayer interrupting playback with audioPlayerDecodeErrorDidOccur, with avaudioplayer osstatus error NSOSStatusErrorDomain -50 http://stackoverflow.com/questions/4378633/avaudioplayer-interrupting-playback-with-audioplayerdecodeerrordidoccur-with-ns Посмотреть решение → c# x 50271 java x 31993 php x 29097 javascript x 25168 .net x 23584 asp.net x 21065 jquery x 20949 iphone x 20022 c++ x 19637 python x 16462 sql x 12876 mysql x 12483 html x 11579 android x 11332 ruby-on-rails x 9890 vresheno.ru © 2013 все права защищены
from GoogleSign inHidden fieldsSearch for groups or messages