jfalexvijay
jfalexvijay

Reputation: 3711

OSStatus error 1718449215

I have created an iPhone application to record our voice. When I try to record, I am getting error message in following statement.


recorder = [[ AVAudioRecorder alloc] initWithURL:url settings:recordSetting error:&err];

Error Domain=NSOSStatusErrorDomain Code=1718449215 "Operation could not be completed. (OSStatus error 1718449215.)"

If I tried to record in .caf file, it is working fine. If I tried with .m4a, I am getting this error message.

Please help me to resolve it.

Thanks.

Upvotes: 40

Views: 29326

Answers (9)

Anagha A
Anagha A

Reputation: 1

This issue is because of save file format. in IOS use WAV format

Upvotes: 0

Eric
Eric

Reputation: 16921

My favourite tool for deciphering OSStatus codes is https://osstatus.com

OSStatus error 1718449215 is kAudioConverterErr_FormatNotSupported, which may mean:

  • The format you're trying to export to is not supported (double check the file extension of your output file URL).

  • There's an issue with the recordSettings. One thing to look out for is that the value of the AVFormatIDKey matches the file extension of the output file URL.

Upvotes: 1

peng
peng

Reputation: 11

"NSDictionary" if it is empty, the default is high quality, if you set, this value will be very low, you can try to cancel these parameters:

setting[AVFormatIDKey] = @(kAudioFormatAppleIMA4);
setting[AVSampleRateKey] = @(600.0);
setting[AVNumberOfChannelsKey] = @(1);
setting[AVLinearPCMBitDepthKey] = @(8);

Upvotes: 1

Ryan Maloney
Ryan Maloney

Reputation: 1046

UInt32 code = CFSwapInt32HostToBig(error);
NSLog(@"%4.4s"(char *)&code);

Upvotes: 0

Gagan_iOS
Gagan_iOS

Reputation: 4060

I also faced this issue when I converted file type to .mp3 while previously I was using .caf format for recording sound with AVAudioRecorder. I again converted file type to.caf format & it works. You may use following formats

AAC, PCM, IMA4, ULAW, ILBC

Upvotes: 4

ICL1901
ICL1901

Reputation: 7778

In case this helps others: I just had the same error, and it was caused by trying to create/use audio files in the wrong format. I had preset the recording to create a .caf file, but instead, called the file xxx.wav.

Upvotes: 13

Tavison
Tavison

Reputation: 1563

If you're in c or cpp code you can do this.

char code[4];
*((SInt32*)&code[0]) = error;

Upvotes: 0

fbrereto
fbrereto

Reputation: 35925

1718449215 is the decimal representation of the four character code for the kAudioFormatUnsupportedDataFormatError error.

In general you can use something like this to get more information from the errors you receive:

NSError *error = [NSError errorWithDomain:NSOSStatusErrorDomain
                          code:my_error_code
                          userInfo:nil];
NSLog(@"Error: %@", [error description]);

Upvotes: 76

zoul
zoul

Reputation: 104065

OSStatus error codes are pain, they are often too general to help. Did you try to decode the four-char error code? Sometimes that helps (other times you just get garbage). Create and show us a minimal code example that exhibits the problem. In this case I bet that the four-char code is fmt?. Google for the numeric code and you should be wiser.

Upvotes: 4

Related Questions