AVAudioPlayer初始化错误 [英] AVAudioPlayer initialization error

查看:240
本文介绍了AVAudioPlayer初始化错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我初始化我的AVAudioPlayer实例,如:

I initialize my AVAudioPlayer instance like:

[self.audioPlayer initWithContentsOfURL:url error:&err];

url包含.m4a文件的路径

url contains the path of an .m4a file

调用此行时,控制台中会显示以下错误:错误域= NSOSStatusErrorDomain代码= 1685348671无法完成操作。 (OSStatus错误1685348671。)

The following error is displayed in the console when this line is called :"Error Domain=NSOSStatusErrorDomain Code=1685348671 "Operation could not be completed. (OSStatus error 1685348671.)"

出现此错误的原因是什么?

What is the reason for this error?

推荐答案

错误代码是dta?的四字符代码(您可以在程序员模式下使用Calculator应用程序将int值转换为ASCII)。检查结果代码各种Core Audio引用,您会发现它在音频文件服务和音频文件流服务中定义为 kAudioFileInvalidFileError kAudioFileStreamError_InvalidFile ,两者都有相同的定义:

The error code is a four-char-code for "dta?" (you can use the Calculator app in programmer mode to convert the int values to ASCII). Check the "result codes" of the various Core Audio references and you'll find this is defined in both Audio File Services and Audio File Stream Services as kAudioFileInvalidFileError or kAudioFileStreamError_InvalidFile respectively, both of which have the same definition:


文件格式错误,不是其音频文件的有效实例输入或不被识别为音频文件。适用于iPhone OS 2.0及更高版本。

The file is malformed, not a valid instance of an audio file of its type, or not recognized as an audio file. Available in iPhone OS 2.0 and later.

您是否尝试过使用不同的.m4a代码文件?

Have you tried your code with different .m4a files?

这篇关于AVAudioPlayer初始化错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆