在iOS8中,AudioFileReadPackets已被弃用。

5

自从iOS 8开始,AudioFileReadPackets已经过时,我遇到了一些奇怪的行为。应该如何替换它呢?

1个回答

10

来自苹果文档:

AudioFileReadPackets在iOS 8.0中已被弃用。您可以尝试使用this:AudioFileReadPacketData

If you do not need to read a fixed duration of audio data, but rather want to use your memory buffer most efficiently, use AudioFileReadPacketData instead of AudioFileReadPackets .When reading variable bit-rate (VBR) audio data, using AudioFileReadPackets function requires that you allocate more memory than you would for the AudioFileReadPacketData function. See the descriptions for the outBuffer parameter in each of these two functions. In addition, AudioFileReadPackets function is less efficient than AudioFileReadPacketData when reading compressed file formats that do not have packet tables, such as MP3 or ADTS. Use this function only when you need to read a fixed duration of audio data, or when you are reading only uncompressed audio.

Audio File Services reads one 32-bit chunk of a file at a time.

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接