AudioFileReadBytes error
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.
精彩评论