• 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
[Audio Input Bus] Getting Buffers
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Audio Input Bus] Getting Buffers


  • Subject: [Audio Input Bus] Getting Buffers
  • From: "Malik 522" <email@hidden>
  • Date: Thu, 13 Oct 2005 11:05:20 +0000

hi all

I would like to catch buffers from the output of the Audio Input Bus.

My Input Scope is configured like this :
-----------------------------------------------------
   input.mSampleRate = 44100

   input.mBytesPerPacket = 4

   input.mFramesPerPacket = 1

   input.mBytesPerFrame = 4

   input.mChannelsPerFrame = 1

   input.mBitsPerChannel = 32
-----------------------------------------------------


and I configure my Output Scope like this : ----------------------------------------------------- output.mSampleRate = 8000

   output.mBytesPerPacket = 2

   output.mFramesPerPacket = 1

   output.mBytesPerFrame = 2

   output.mChannelsPerFrame = 1

   output.mBitsPerChannel = 16
-----------------------------------------------------


The problem is that I dont know how to use the AudioUnitRender and its parameters... I want to catch 160 packets, each packet contains 2 bytes. I dont know why, but AudioUnitRender works if numberOfFrames=512, but returns an error if numberOfFrames=160...


my code :

----------------------------------------------------------------------------------------------------------
   flags = 0;
   kNumChannels = 160;

theAudioData = (AudioBufferList *)malloc(offsetof(AudioBufferList, mBuffers[kNumChannels]));

   theAudioData->mNumberBuffers = kNumChannels;

   for (int i = 0; i < kNumChannels; i++)
   {
      theAudioData->mBuffers[i].mNumberChannels = 1;
      theAudioData->mBuffers[i].mDataByteSize = 2;
      theAudioData->mBuffers[i].mData = NULL;
   }

OSStatus err = AudioUnitRender(theInputUnit, &flags, &myTimeStamp, 1, numberOfFrames, theAudioData); // it doesnt work if numberOfFrames=160...

   myTimeStamp.mSampleTime += kNumFramesPerSlice;
----------------------------------------------------------------------------------------------------------


Any idea ?

thx in advance

Dragoon


_______________________________________________ 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:
    • Sampling Rate Master
      • From: BlazeAudio Developer <email@hidden>
  • Prev by Date: RE: Audio Units - newbie questions
  • Next by Date: Format Converters
  • Previous by thread: Re: Stereo Mixer metering
  • Next by thread: Sampling Rate Master
  • Index(es):
    • Date
    • Thread