• 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: InputCallbacks and buffer size
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: InputCallbacks and buffer size


  • Subject: Re: InputCallbacks and buffer size
  • From: William Stewart <email@hidden>
  • Date: Wed, 30 Aug 2006 16:40:33 -0700

You can't provide more or less data to an audio unit than what is asks for... you have to provide just what it asks for

On 30/08/2006, at 3:48 PM, Hari Seldon wrote:


So I now have smooth streaming audio by filling the buffer provided by to the inputCallback (by the AUConverter), but really don't like performing a memcpy for each 2k (512 frame) chunk of audio.


I was reading some examples where people made their own ABL filled with data and assigned this to *ioData. I've tried this and it works, but the results are not necessarily what I was looking for since the AUConverter still thinks that data represents 512 frames (verified by restricting my new ABL to 2k). The example I looked at was just reassigning the count of frames to the new desired amount but the inputProc's inNumberFrames is read only.

How do I tell it the new frame number so that I can pass larger chunks of data?

Just want to get the audio running at less than 11-12% cpu on a mac mini, as eventually adding codecs and video is going to require more processing.

Thanks

Quoting Hari Seldon <email@hidden>:

Quoting William Stewart <email@hidden>:


On 18/08/2006, at 10:20 AM, Hari Seldon wrote:

Also, currently I copy data (interleaved signed int data) into the buffer provided to the inputcallback; is this the best approach?

You can reset the data pointers provided to you in the ABL - you then
have to keep those pointers valid until the next time the AU calls you
for data - that is the only clear time that you know that the AU is
finished processing your input.



How do you mean? I can setup the input callback to read the data from
a buffer that I own, just by passing it pointers to the buffer? How
is this done, as I haven't seen an example of it. I would be
interested in something like this as I'd prefer not to slow the system
down with another memcpy, if I already have the data awaiting playback
in a circular buffer.


Thanks



--
mailto:email@hidden
tel: +1 408 974 4056
________________________________________________________________________ __
"Much human ingenuity has gone into finding the ultimate Before.
The current state of knowledge can be summarized thus:
In the beginning, there was nothing, which exploded" - Terry Pratchett
________________________________________________________________________ __


_______________________________________________
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: InputCallbacks and buffer size
      • From: Hari Seldon <email@hidden>
References: 
 >InputCallbacks and buffer size (From: Hari Seldon <email@hidden>)
 >Re: InputCallbacks and buffer size (From: William Stewart <email@hidden>)
 >Re: InputCallbacks and buffer size (From: Hari Seldon <email@hidden>)
 >Re: InputCallbacks and buffer size (From: Hari Seldon <email@hidden>)

  • Prev by Date: Re: InputCallbacks and buffer size
  • Next by Date: Re: InputCallbacks and buffer size
  • Previous by thread: Re: InputCallbacks and buffer size
  • Next by thread: Re: InputCallbacks and buffer size
  • Index(es):
    • Date
    • Thread