Reading audio with Extended Audio File Services (ExtAudioFileRead)

后端 未结 4 1749
暖寄归人
暖寄归人 2021-02-10 17:17

I am working on understanding Core Audio, or rather: Extended Audio File Services

Here, I want to use ExtAudioFileRead() to read some audio data from a file

4条回答
  •  旧时难觅i
    2021-02-10 17:41

    I think you're misunderstanding the purpose of the mNumberBuffers field. It's typically 1 for mono and interleaved stereo data. The only reason you would set it to something else is for multi-track data where each channel is in a separate data buffer.

    If you want to read a part of a file, you would set dataByteSize of the buffer to a reasonable size, and when you read the file, tell the API only to give you that many bytes, and loop over it.

提交回复
热议问题