OSStatus error 1718449215
Asked Answered
H

8

40

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.

Hummingbird answered 23/11, 2010 at 17:42 Comment(3)
The question is out of date, but since I came here through Google I'd share this reference : osstatus.com allows you to look up the error codesHeathcote
@Heathcote It may be old, but it's not out of date. I had the same error in 2017!Florrieflorry
Same error occurring in my case too. @HeathcoteLambart
V
76

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]);
Vanscoy answered 23/11, 2010 at 18:15 Comment(1)
.m4a is a file format, not a codec. The codec you are recording in is determined by AVFormatIDKey.Craniometry
P
13

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.

Pali answered 21/2, 2012 at 13:19 Comment(2)
I had this same error when I had AVFormatIDKey set to kAudioFormatLinearPCM (wav format) but had forgotten to change the file extension on the destination file from .m4a to .wav.Silverstein
Hi what extension should I have for kAudioFormatAMR? Thanks!Berni
O
4

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.

Obeah answered 23/11, 2010 at 17:58 Comment(0)
C
4

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

Chinkapin answered 5/6, 2014 at 11:42 Comment(1)
Thanks for the formats, which file extensions are allowed by iOS? for examploe, what is the file extension for an ULAW formatted file?Indigested
S
1

"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);
Sliding answered 2/4, 2016 at 8:12 Comment(5)
I've removed the comments in Chinese from your post. If they are crucial to your answer, please translate them into English and add them back. StackOverflow is for English only. Thanks!Cuneo
oh i see..thanks for your clarification. Dear, please forgive my English is not very good, but you can try this answer, I hope this answer will help to youSliding
Thank you for reminding me, forgive my carelessness, I will pay attention to it later,and I want to say you're right.Thanks!Sliding
Not a problem at all :)Cuneo
A wonderful day,In China this time has been late at night,Have a good time. Bye. 😊Sliding
H
1

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.

Holmberg answered 19/8, 2020 at 13:26 Comment(0)
A
0

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

char code[4];
*((SInt32*)&code[0]) = error;
Airily answered 18/8, 2011 at 10:22 Comment(0)
P
0
UInt32 code = CFSwapInt32HostToBig(error);
NSLog(@"%4.4s"(char *)&code);
Pervasive answered 14/10, 2015 at 4:41 Comment(1)
Please consider editing your answer to include an explanation of how your code works.Hypnotist

© 2022 - 2024 — McMap. All rights reserved.