• 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
AudioConverterConvertBuffer & sampleRate
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

AudioConverterConvertBuffer & sampleRate


  • Subject: AudioConverterConvertBuffer & sampleRate
  • From: Pierre-Olivier Latour <email@hidden>
  • Date: Wed, 22 Jan 2003 00:29:15 -0800

Hi,

I'm trying to use the AudioConverterConvertBuffer, but apparently it fails
when the frequency differs between the two formats.
Right now, I load the content of an audio file in memory and then convert it
to the format used by the default audio output device. I convert the whole
data at once with AudioConverterConvertBuffer

If the frequency differs (e.g. Audio data is 22Khz and device is 44Khz), it
fails with an error indicating passed number of samples is wrong. Obviously,
it's because it needs more samples to perform rate conversion, but the
problem is: how do I pass these extra samples to the AudioConverter?

Note: I tried changing the kAudioConverterPrimeMethod property or setting
the leadingFrames and trailingFrames to 0 in kAudioConverterPrimeMethod, but
this had no effect.

My code do this:
outSize = numBytes;
AudioConverterGetProperty(converter,
kAudioConverterPropertyCalculateOutputBufferSize, &dataSize, &outSize);
outBuffer = malloc(outSize);
AudioConverterConvertBuffer(converter, numBytes, inBuffer, &outSize,
outBuffer);

_____________________________________________________________

Pierre-Olivier Latour email@hidden
Palo Alto, USA http://www.pol-online.net
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: AudioConverterConvertBuffer & sampleRate
      • From: Christof Faller <email@hidden>
  • Prev by Date: Re: MusicPlayerStop() and all-notes-off messages
  • Next by Date: Re: AudioConverterConvertBuffer & sampleRate
  • Previous by thread: ANN: Buffer Override AU with GUI
  • Next by thread: Re: AudioConverterConvertBuffer & sampleRate
  • Index(es):
    • Date
    • Thread