操作系统状态错误 1718449215
我创建了一个 iPhone 应用程序来录制我们的声音。当我尝试记录时,我在以下语句中收到错误消息。
recorder = [[ AVAudioRecorder alloc] initWithURL:url settings:recordSetting error:&err];
错误域=NSOSStatusErrorDomain代码=1718449215“操作无法完成。(OSStatus错误1718449215。)”
如果我尝试在.caf文件中记录,它工作正常。如果我尝试使用 .m4a,我会收到此错误消息。
请帮我解决它。
谢谢。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(9)
1718449215 是
kAudioFormatUnsupportedDataFormatError
错误的四字符代码的十进制表示形式。一般来说,您可以使用类似的方法从收到的错误中获取更多信息:
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:
如果这对其他人有帮助:我刚刚遇到了同样的错误,这是由于尝试以错误的格式创建/使用音频文件引起的。我已预设录音以创建 .caf 文件,但将其命名为 xxx.wav 文件。
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.
OSStatus 错误代码很痛苦,它们通常太笼统,无法提供帮助。您是否尝试解码四字符错误代码?有时这会有所帮助(有时你只会得到垃圾)。创建并向我们展示一个展示问题的最小代码示例。在这种情况下,我打赌四字符代码是
fmt?
。谷歌一下数字代码,你应该更聪明。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.当我将文件类型转换为 .mp3 时,我也遇到了这个问题,而之前我使用 .caf 格式通过 AVAudioRecorder 录制声音。我再次将文件类型转换为 .caf 格式 &有用。您可以使用以下格式
AAC、PCM、IMA4、ULAW、ILBC
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
“NSDictionary”如果为空,默认是高质量,如果设置了,这个值会很低,你可以尝试取消这些参数:
"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:
我最喜欢的解密 OSStatus 代码的工具是 https://osstatus.com
OSStatus 错误 1718449215 是
kAudioConverterErr_FormatNotSupported
,这可能意味着:不支持您尝试导出的格式(请仔细检查输出文件 URL 的文件扩展名)。
recordSettings
存在问题。需要注意的一件事是AVFormatIDKey
的值与输出文件 URL 的文件扩展名匹配。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 theAVFormatIDKey
matches the file extension of the output file URL.如果您使用 c 或 cpp 代码,则可以执行此操作。
If you're in c or cpp code you can do this.
此问题是由于保存文件格式造成的。在IOS中使用WAV格式
This issue is because of save file format. in IOS use WAV format