• 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
Static when playing back buffers
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Static when playing back buffers


  • Subject: Static when playing back buffers
  • From: Pier <email@hidden>
  • Date: Thu, 08 Nov 2012 17:16:15 +0800

Hi, 

I used 

        AURenderCallbackStruct mcallbackStruct;

        mcallbackStruct.inputProc = mixedRecordingCallback;

        mcallbackStruct.inputProcRefCon = &rio;

        status = AudioUnitAddRenderNotify(_mixerUnit, mcallbackStruct.inputProc,  mcallbackStruct.inputProcRefCon);

to add the callback to my mixer AudioUnit. 

I'm getting static when trying to playback finalOutputBuffer (captured below). 
I've noticed that there are 2 buffers in ioData this time round - that never happened before. I suspect that this could be the problem, has anyone had any experience with this? 

Thanks. 

Pier. 

static OSStatus mixedRecordingCallback(void *inRefCon,

                                         AudioUnitRenderActionFlags *ioActionFlags,

                                         const AudioTimeStamp *inTimeStamp,

                                         UInt32 inBusNumber,

                                         UInt32 inNumberFrames,

                                         AudioBufferList *ioData)

{

  

    if (*ioActionFlags & kAudioUnitRenderAction_PostRender) {

        

        RIO *rio = (RIO*)inRefCon;

        static int TEMP_kAudioUnitRenderAction_PostRenderError = (1 << 8);

        SInt16 *targetBuffer;

        

        

        if (rio->recordingMixed)

        {

            if (0 == inBusNumber && !(*ioActionFlags & TEMP_kAudioUnitRenderAction_PostRenderError)) {

            NSLog(@"Recording Mixed Output : Bus %ld", inBusNumber);

            

            for (int i=0; i < ioData->mNumberBuffers; i++)

            {

                targetBuffer= (SInt16*)ioData->mBuffers[i].mData;

                TPCircularBufferProduceBytes(&rio->finalOutputBuffer, targetBuffer, inNumberFrames  * sizeof(SInt16));

            }

                


            }

        }

    }

    return noErr;

}

 _______________________________________________
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: Static when playing back buffers
      • From: Pier <email@hidden>
  • Prev by Date: Subject: MIDIEvent ambiguous name lookup in Core Audio Utility Classes
  • Next by Date: USB High-Speed uFrame Limitations
  • Previous by thread: Subject: MIDIEvent ambiguous name lookup in Core Audio Utility Classes
  • Next by thread: Re: Static when playing back buffers
  • Index(es):
    • Date
    • Thread