开发者

AudioFileReadBytes error

开发者 https://www.devze.com 2023-01-02 08:13 出处:网络
I read a file .caf with my program. I use AudioFileReadBytes, but its OSStatus that r开发者_Go百科eturn is -39, what is this??

I read a file .caf with my program. I use AudioFileReadBytes, but its OSStatus that r开发者_Go百科eturn is -39, what is this?? thanks


Error number -39 (negative thirty-nine) is eofErr, a Mac OS Carbon error, which comes from the original Mac toolbox from the 1984. It's defined in MacErrors.r. That means it reached the end of the file, and there are no more bytes to read. You should note the number of bytes returned and complete whatever processing you're doing of the file at that point.

If you want to avoid the error, you can read the file length and number of samples from the various API calls, and calculate how many bytes to read, and never go past the end of the file.

0

精彩评论

暂无评论...
验证码 换一张
取 消