AVAudioPlayer initialization error

前端 未结 1 2007
伪装坚强ぢ
伪装坚强ぢ 2021-01-12 03:41

I initialize my AVAudioPlayer instance like:

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

url contains the path of an .m4a

相关标签:
1条回答
  • 2021-01-12 04:16

    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:

    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.

    Have you tried your code with different .m4a files?

    0 讨论(0)
提交回复
热议问题