AudioConverterFillComplexBuffer return -50 (paramErr)

前端 未结 2 1558
伪装坚强ぢ
伪装坚强ぢ 2021-01-23 02:57

I\'m trying to convert a PCM 32-bit float audio stream to ALAC. I found some working examples to build from, but my own code keeps getting a -50 (paramErr) from AudioConverterFi

相关标签:
2条回答
  • 2021-01-23 03:44

    I experienced the same problem (AudioConverterFillComplexBuffer returning -50)
    -
    but it appeared only after restarting the same converter with a second file after the first one played to the end. The first file converted perfectly without problems.

    With the help of Claude's answer (THANKS!) I found out that the converter actually changes the size of the AudioBufferList to 0 if the end of the file is reached.

    After resetting the AudioBufferList's sizes to the original values everthing works now as expected.

    0 讨论(0)
  • 2021-01-23 03:46

    I was stuck in the same situation (basically after using your code as a template). Solution seems to be in allocation of memory for the AudioBufferList. Implementing this answer did the trick for me (although my objective-C is not good enough to see the exact difference :))

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