• 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: Trouble recording using the AUHAL unit.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Trouble recording using the AUHAL unit.


  • Subject: Re: Trouble recording using the AUHAL unit.
  • From: Alexander Bollbach <email@hidden>
  • Date: Mon, 11 Jan 2016 17:15:00 +0000

thinking a little more,  given that i'm recording an arbitrarily long amount of audio, preallocating a buffer will not be possible, right?  Is that where a circular buffer comes in?  would I use the much used CARingBuffer?  If so, could I get some intuition about the timestamps.  I've followed chapter 8 of Chris Adamson's Learning Core Audio book and I sort of have a sense for using a RingBuffer but i'm not entirely clear on the concept of the timestamps you pass into it.

On Mon, Jan 11, 2016 at 12:09 PM Alexander Bollbach <email@hidden> wrote:
So I've actually read that a few days ago.  i guess because the function was a core audio i didn't make the connection that it was i/o accessing. but right, i do recall that i/o restriction in the callback.  What do you think was happening?  it was only writing a a fraction of the total frame bytes before the callback returned? how do you account for the fact that the resultant wav file was long and shorter based on how long i ran the program?  

anyway, now that I know this won't work, what is the right approach?  Do I need to fill up a buffer in RAM and than start to offload those bytes into the audiofile back on a non-realtime thread?

On Mon, Jan 11, 2016 at 7:36 AM Paul Davis <email@hidden> wrote:
On Mon, Jan 11, 2016 at 2:08 AM, Alexander Bollbach <email@hidden> wrote:

I am trying to record small chunks of PCM for this beat making app I'm writing and so I figured it would be easy enough to just do AudioFileWriteBytes in this callback and multiply the number of frame with how many bytes per frame and just write it but the file winds up being a garbled mess.

You cannot do file i/o from a render callback or anywhere else in the realtime audio thread(s).

Please read this, which isn't about audiounits but is about realtime audio programming.

http://www.rossbencina.com/code/real-time-audio-programming-101-time-waits-for-nothing

 _______________________________________________
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: Trouble recording using the AUHAL unit.
      • From: Paul Davis <email@hidden>
References: 
 >Trouble recording using the AUHAL unit. (From: Alexander Bollbach <email@hidden>)
 >Re: Trouble recording using the AUHAL unit. (From: Paul Davis <email@hidden>)
 >Re: Trouble recording using the AUHAL unit. (From: Alexander Bollbach <email@hidden>)

  • Prev by Date: Re: Trouble recording using the AUHAL unit.
  • Next by Date: Re: Trouble recording using the AUHAL unit.
  • Previous by thread: Re: Trouble recording using the AUHAL unit.
  • Next by thread: Re: Trouble recording using the AUHAL unit.
  • Index(es):
    • Date
    • Thread