• 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: still super duper frustrated about the au graph..
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: still super duper frustrated about the au graph..


  • Subject: Re: still super duper frustrated about the au graph..
  • From: "Dave O'Neill" <email@hidden>
  • Date: Sat, 21 Mar 2015 10:07:09 -0700

I went ahead and ran your gist and all I had to do was use kAudioUnitSubType_DefaultOutput rather than kAudioUnitSubType_GenericOutput and I got a working lowpass with a render callback, you were very close!  I did not set any ASBDs anywhere.  And for the offline render, following christian's advice is the way to go.  You don't need a graph or io unit, just AudioUnitInitialize your lowpass unit. I also checked out EZAudio.m from Haris and it has easy to read code for how to get some common ASBDs, and how to initialize the AudioBufferlist that you will need for doing the offline render. It's definitely worth a study, especially if your having trouble finding examples online.



Here I do the AudioBufferList setup and then thirty renders of 1024 frames of stereo float data:

AudioBufferList *bufferlist = malloc(sizeof(AudioBufferList) + sizeof(AudioBuffer)); //stereo bufferlist
float *left = malloc(sizeof(float) * 1024);
float *right = malloc(sizeof(float) * 1024);
bufferlist->mBuffers[0].mData = left;
bufferlist->mBuffers[1].mData = right;
    
AudioTimeStamp inTimeStamp;
memset(&inTimeStamp, 0, sizeof(AudioTimeStamp));
inTimeStamp.mFlags = kAudioTimeStampSampleTimeValid;
inTimeStamp.mSampleTime = 0;
    
AudioUnitRenderActionFlags flag = 0;
   
for (int i = 0; i < 30; i++) {
    bufferlist->mBuffers[0].mDataByteSize = sizeof(float) * 1024;
    bufferlist->mBuffers[1].mDataByteSize = sizeof(float) * 1024;
    bufferlist->mNumberBuffers = 2;
    AudioUnitRender(lowPass, &flag, &inTimeStamp, 0, 1024, bufferlist);
    //do something with audio here
    inTimeStamp.mSampleTime += 1024;
}


On Sat, Mar 21, 2015 at 8:56 AM, Patrick J. Collins <email@hidden> wrote:
> But here is a stere float one anyway:
>
> mSampleRate              44100.000000
> mFormatFlags             kAudioFormatFlagIsFloat | kAudioFormatFlagIsNonInterleaved | kAudioFormatFlagIsPacked 
> mFormatID                  kAudioFormatLinearPCM
> mFramesPerPacket   1
> mBytesPerFrame       4
> mChannelsPerFrame 2
> mBitsPerChannel      32
> mBytesPerPacket      4

Yeah these asbds do not work on the graph, for whatever no matter what I
do.  If I put them on the output node, I get -50, and if i put them on
the lowpass node, I get -10868...

I am using audio units in another class where I do
AudioComponentInstanceNew and AudioUnitInitialize...  And I can set the
asbd no problem, and it plays my buffer perfectly.

However, as soon as the graph is involved, nothing works.

Patrick J. Collins
http://collinatorstudios.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

  • Follow-Ups:
    • Re: still super duper frustrated about the au graph..
      • From: "Patrick J. Collins" <email@hidden>
    • Re: still super duper frustrated about the au graph..
      • From: "Patrick J. Collins" <email@hidden>
References: 
 >still super duper frustrated about the au graph.. (From: "Patrick J. Collins" <email@hidden>)
 >Re: still super duper frustrated about the au graph.. (From: "Dave O'Neill" <email@hidden>)
 >Re: still super duper frustrated about the au graph.. (From: Haris Ali <email@hidden>)
 >Re: still super duper frustrated about the au graph.. (From: "Patrick J. Collins" <email@hidden>)

  • Prev by Date: Re: still super duper frustrated about the au graph..
  • Next by Date: Re: still super duper frustrated about the au graph..
  • Previous by thread: Re: still super duper frustrated about the au graph..
  • Next by thread: Re: still super duper frustrated about the au graph..
  • Index(es):
    • Date
    • Thread