• 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: Using AudioConverter
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using AudioConverter


  • Subject: Re: Using AudioConverter
  • From: Doug Wyatt <email@hidden>
  • Date: Mon, 18 Oct 2004 10:06:00 -0700

On Oct 18, 2004, at 5:04, Patrick Machielse wrote:
op 17-10-2004 22:41 schreef Doug Wyatt

On Oct 16, 2004, at 6:06, Patrick Machielse wrote:
    //
    //  convert the buffer (fails with error -50)
    //
    UInt32 outSize = 0;
    err = AudioConverterConvertBuffer(conv,
                                      inBufSize,
                                      (void*)inBuf,
                                      &outSize,
                                      (void*)outBuf);

-50 is paramErr, a standard MacOS error code, indicating that a
function was passed an invalid parameter value. The fourth parameter is
"ioOutputDataSize". The "io" prefix indicates that the value is
significant both on entry and exit from the function. On entry it is
the size of the output buffer in bytes. On exit it is the number of
bytes written into the output buffer. AudioConverterConvertBuffer is
returning paramErr because *ioOutputDataSize is 0 on entry. Change it
to be the real size of the buffer in bytes.

Yes! Thank you, that's music to my ears! (really)

Being mostly a Cocoa developer, I didn't pick up the subtle indicators in
the header files. ;-)


That being said, I will file a documentation enhancement request / bug,
since the AudioConverterConvertBuffer() function is not discussed in the
Audio Toolbox documentation (at least the version that came with Xcode 1.2),
although it is referenced in it.

That can't hurt.

The function isn't by chance deprecated, as are AudioConverterFillBuffer()
c.s.?

No, it's not deprecated. AudioConverterFillBuffer isn't either -- we'll just warn you that AudioConverterConvertBuffer is limited to cases where you know exactly how much input to provide to produce the desired amount of output, which normally means no non-CBR formats or sample rate conversion.


Doug

_______________________________________________
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: Using AudioConverter
      • From: Patrick Machielse <email@hidden>
References: 
 >Re: Using AudioConverter (From: Patrick Machielse <email@hidden>)

  • Prev by Date: Rez problem
  • Next by Date: Re: AuBase::GetLatency()
  • Previous by thread: Re: Using AudioConverter
  • Next by thread: Re: Using AudioConverter
  • Index(es):
    • Date
    • Thread