• 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
AudioConverterFillComplexBuffer getting error - Invalid Argument
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

AudioConverterFillComplexBuffer getting error - Invalid Argument


  • Subject: AudioConverterFillComplexBuffer getting error - Invalid Argument
  • From: sheen mac <email@hidden>
  • Date: Wed, 20 Dec 2006 07:05:02 -0800 (PST)

Hi All,

I am developing a record and playback program.In which I captured
the data using callback and try to convert it using AudioConverterFillComplexBuffer.
At that time,I was getting an error as 'Invalid Argument'.I enclosed the
code here.

Kindly help me.

Thanks in Advance,
Sheen

code
//========================

OSStatus SupplyData (AudioConverterRef inAudioConverter,
                     UInt32* ioNumberDataPackets,
                     AudioBufferList* ioData,
                     AudioStreamPacketDescription** outDataPacketDescription,
                    void* inUserData)


{
    ioData->mBuffers[0].mData = fAudioBuffer->mBuffers[0].mData;
    ioData->mBuffers[0].mDataByteSize =  fAudioBuffer->mBuffers[0].mDataByteSize;
   
    return noErr;
}


OSStatus AudioInputProc(void* inRefCon, AudioUnitRenderActionFlags* ioActionFlags, const AudioTimeStamp* inTimeStamp, UInt32 inBusNumber, UInt32 inNumberFrames, AudioBufferList* ioData)
{
    OSStatus    err = noErr;
     
    err=AudioUnitRender(fAudioUnit,ioActionFlags,inTimeStamp,inBusNumber,inNumberFrames,fAudioBuffer);

   
    UInt32 auSize=fAudioBuffer->mBuffers[0].mDataByteSize;
   
    err=AudioConverterFillComplexBuffer(conv,
                                        SupplyData,
                                        fAudioBuffer->mBuffers[0].mData,
                                        &auSize,
                                        opBufList,
                                        NULL);
       
    if(err != noErr)
    {
        fprintf(stderr, strerror(errno));
       
    }
   

}   


output Format is
fOutputFormat.mChannelsPerFrame = 1;
    fOutputFormat.mSampleRate = 48000.0;
    fOutputFormat.mFormatID = kAudioFormatLinearPCM;
    fOutputFormat.mFormatFlags = kAudioFormatFlagsNativeFloatPacked;
    fOutputFormat.mBitsPerChannel = 32;
    fOutputFormat.mBytesPerFrame = 4;
    fOutputFormat.mFramesPerPacket = 1;
    fOutputFormat.mBytesPerPacket = 4;


@end

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

 _______________________________________________
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

  • Prev by Date: any alternate for ConvertMovieToFile function???
  • Next by Date: Re: Adding info dictionary to AAC export
  • Previous by thread: any alternate for ConvertMovieToFile function???
  • Next by thread: Side chains in Logic
  • Index(es):
    • Date
    • Thread