7

I just received a result code(-50) returned from ExtAudioFileWrite().

And I didnt't find the information about this result code in "Extended Audio File Services Reference".

Please help me to resolve it.

Thanks.

Solskjaer
  • 175
  • 1
  • 11
  • 1
    Error -50 means there’s an error in the arguments you’ve passed to a function. Make sure that all the arguments you’re passing to `ExtAudioFileWrite()` are correct. –  Oct 24 '11 at 04:43

3 Answers3

13

This error code is declared in MacErrors.h of the CarbonCore framework. -50 is paramErr. IOW, one of your parameters is invalid. So you will need to verify your parameters, buffer sizes, arguments that you pass and so on to locate the parameter which has been flagged.

justin
  • 104,054
  • 14
  • 179
  • 226
  • `paramErr` has often been used as a "catch-all" sort of error, so it might be hard to narrow down. An invalid parameter can mean almost anything. – StilesCrisis Jun 03 '13 at 21:51
  • 1
    Pay closer attention to AudioStreamBasicDescription – Ramesh Nov 07 '13 at 23:22
  • 1
    Good answer.. [MacErrors.h](http://www.opensource.apple.com/source/CarbonHeaders/CarbonHeaders-18.1/MacErrors.h) – bobobobo Jan 03 '14 at 15:49
-1

Add the code to the initialization of project

NSArray *availableInputs = [[AVAudioSession sharedInstance] availableInputs];
    AVAudioSessionPortDescription *port = [availableInputs objectAtIndex:0];  //built in mic for your case
    NSError *portErr = nil;
    [[AVAudioSession sharedInstance] setPreferredInput:port error:&portErr];
Muhammad Muazzam
  • 2,810
  • 6
  • 33
  • 62
-1

errSecParam = -50, /* One or more parameters passed to a function were not valid. */

you can find all error in Security->SecBase.h

Binny
  • 1