Re: ExtAudioFileWrite, error -40 [resolved]
Re: ExtAudioFileWrite, error -40 [resolved]
- Subject: Re: ExtAudioFileWrite, error -40 [resolved]
- From: Anders Norlander <email@hidden>
- Date: Tue, 16 Nov 2010 16:54:45 +0100
I found that the opposite situation also gives you an error, but slightly less confusing.
If you the number of frames to write is less than the maximum that would fit in the buffers
(as specified by mDataByteSize) you get a -50 (paramErr).
So I had to adjust the buffer sizes when writing the last frames to an audio file.
I suppose the error might actually come from AudioConverter services and not ExtAudioFile.
That was on OS X 10.6.4.
Seems a bit silly, since the buffer sizes are just a maximum size out which you may not use every byte.
-Anders
On 2010-11-15, at 23:17 , Edwards, Waverly wrote:
>
> I found the answer to my problem. The framecount was more than the number of frames in the conversion buffer. What I don't understand is why I was getting this error. I had not change the disk writing code in a couple of months. This code had been working even though my framecount was high. Since I started receiving the -40 error, I realized the framecount was high for every file I tried to write, however, the file did write to disk in some instances but not others.
>
> status = ExtAudioFileWrite(outputFile, frameCount, &conversionBuffer);
>
> The easy answer is don't use a framecount that is too high for the buffer size but why this error message? The error message I received is not intuitive or even make sense.
>
> Hopefully, this helps someone else in the future.
>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden