Reading audio with Extended Audio File Services (ExtAudioFileRead)

后端 未结 4 1737
暖寄归人
暖寄归人 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条回答
  •  野趣味
    野趣味 (楼主)
    2021-02-10 17:26

    I also had the same problem with mNumberBuffers > 1,,... My work around involved creating my own internal buffer:

    something like:

    char buffer1[byteSize]; char buffer2[byteSize]; ......

    you could also use pointers to make things easier,..like:

    buffer[index][byteSize];

    then you would have to iterate through them manually and fill them up on the main thread to avoid glitches in audio.

    ExtAudioFileRead will only fill buffer[0] in the AudioBufferList, you could then have that pointing to different manually allocated buffers as the audio plays.

    hope this helps.

提交回复
热议问题