• 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: AudioConverterConvertBuffer sample?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AudioConverterConvertBuffer sample?


  • Subject: Re: AudioConverterConvertBuffer sample?
  • From: Ken Wieschhoff <email@hidden>
  • Date: Mon, 4 Mar 2002 18:24:59 -0500

If you could please post an example


I was hoping *you* had an example.....;)


(and/or put it in a bug at bugreporter), that would be helpful.

Well maybe I'm not using it the way it's intended. Here goes...

*************************

// Get the description from the default input unit
mStreamInDesc = GetAudioParameters();

mStreamOutDesc.mSampleRate = 44.100;
mStreamOutDesc.mFormatID = kAudioFormatLinearPCM;
mStreamOutDesc.mFormatFlags = kLinearPCMFormatFlagIsSignedInteger
| kLinearPCMFormatFlagIsBigEndian
| kLinearPCMFormatFlagIsPacked;
mStreamOutDesc.mBytesPerPacket = 4;
mStreamOutDesc.mFramesPerPacket = 1;
mStreamOutDesc.mBytesPerFrame = 4;
mStreamOutDesc.mChannelsPerFrame = 2;
mStreamOutDesc.mBitsPerChannel = 16;

err = AudioConverterNew ( mStreamInDesc,
&mStreamOutDesc,
&mConverter);

CheckError( err, "AudioConverterNew" );

:
:


void ConvertSample(void *inputBuffer, UInt32 inputBufferSize)
{
Handle audioBuffer = NULL;
OSErr err;
UInt32 ioOutputDataSize = inputBufferSize * 2; // make an extra big buffer
// in case the sample changes size


audioBuffer = NewHandle(inputBufferSize * 2);
HLock(audioBuffer);
err = AudioConverterConvertBuffer( mConverter,
inputBufferSize, inputBuffer,
&ioOutputDataSize, *audioBuffer);
CheckError( err, "AudioConverterConvertBuffer" );
// returns paramErr.....
:
:



Doug

On Monday, March 4, 2002, at 03:50 , Ken Wieschhoff wrote:

Did anyone at Apple ever answer this? Is there any online documentation which discusses AudioConverters in general and this routine beside the sample code?

I'm getting a -50 (paramErr) each time I call this routine.

--
Doug Wyatt
work: email@hidden (CoreAudio)
personal: email@hidden http://www.sonosphere.com

"You cannot not communicate."
-- Paul Watzlawick, Pragmatics of Human Communication
_______________________________________________
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.


--
- --
Ken Wieschhoff
(770)813-0231
***************************
_______________________________________________
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 sample?
      • From: Doug Wyatt <email@hidden>
References: 
 >Re: AudioConverterConvertBuffer sample? (From: Doug Wyatt <email@hidden>)

  • Prev by Date: Re: Sound Input in OS X
  • Next by Date: Re: Beginning Sound on OSX
  • Previous by thread: Re: AudioConverterConvertBuffer sample?
  • Next by thread: Re: AudioConverterConvertBuffer sample?
  • Index(es):
    • Date
    • Thread