• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
RE: ExtAudioFileWrite, error -40 [resolved]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: ExtAudioFileWrite, error -40 [resolved]


  • Subject: RE: ExtAudioFileWrite, error -40 [resolved]
  • From: "Edwards, Waverly" <email@hidden>
  • Date: Mon, 15 Nov 2010 16:17:15 -0600
  • Acceptlanguage: en-US
  • Thread-topic: ExtAudioFileWrite, error -40 [resolved]

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.


W.



-----Original Message-----
From: coreaudio-api-bounces+waverly.edwards=email@hidden [mailto:coreaudio-api-bounces+waverly.edwards=email@hidden] On Behalf Of Edwards, Waverly
Sent: Wednesday, November 10, 2010 10:59 AM
To: 'email@hidden'
Subject: ExtAudioFileWrite, error -40


I am using the function ExtAudioFileWrite and I have begun to receive the error -40 when writing the contents of my buffer to file disk.  The descriptive message for error -40 is "tried to position to before the start of the file (r/w)."  I am reading the contents of a file using the ExtAudioFile API fully into a buffer in one shot.  I modify the contents of memory and write the contents out as another file name.  Strangely, the file will show up as a full sized file and then quickly change to a 4K file.

I did not have this problem for before and I have been writing the output for a month or two using a small repertoire of 15 wave files for input.  I began testing using a new set of aiff files for input.  Thinking this may be related I converted one or two aiff files to wave files (to be used as input) to see it made a difference.  Ultimately, I do not know what it means to "...position to before the start..." since the only function I am using to write is ExtAudioFileWrite.  I am not manipulating the position of writing in any way.

Any ideas on what may be causing this -40 error?


Thank you,


W.
 _______________________________________________
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
 _______________________________________________
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

  • Follow-Ups:
    • Re: ExtAudioFileWrite, error -40 [resolved]
      • From: Anders Norlander <email@hidden>
References: 
 >ExtAudioFileWrite, error -40 (From: "Edwards, Waverly" <email@hidden>)

  • Prev by Date: kAudioSessionCategory_PlayAndRecord, input from iphone mic , output to bluetooth
  • Next by Date: Re: ExtAudioFileRead() fills returned buffer partially with empty frame
  • Previous by thread: ExtAudioFileWrite, error -40
  • Next by thread: Re: ExtAudioFileWrite, error -40 [resolved]
  • Index(es):
    • Date
    • Thread