• 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: Streaming audio to built-in audio device
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Streaming audio to built-in audio device


  • Subject: Re: Streaming audio to built-in audio device
  • From: "B. Mitchell Loebel" <email@hidden>
  • Date: Mon, 07 May 2007 14:54:32 -0700

Thank you Mark and the several other members of this list ... superb!

I still have a few questions:
  • your function 'AudioConverterFillComplexBuffer ()' is the function I will use to fill a buffer to which the AU will refer to obtain data. My app has two buffers and I want to assign a pointer (ioData) to a filled buffer each time the callback function is called. Important ... how do I synchronize my app's setting (writing) the buffer pointer and the AU's using (reading) that pointer? Mutexes, semaphores ... ????
  • Here's a cute question ... my buffers are 80 samples long with each sample being 2 bytes wide. If my processing is not yet ready to hand off a full buffer to the AU, I want the AU to use the last single sample from the current buffer until I'm ready. And I want the AU to continue checking to see if I'm ready, i.e. poll. Of course, a better way would be for the AU to continue using the last sample until my thread pulls an interrupt to hand off the OK buffer pointer. How do you suggest I do these things please?
  • What is meant by 'inBusNumber' and 'inNumberFrames' in the renderCallback() function?
Thank you again.


At 11:59 AM 5/7/2007 -0700, Mark Pauley wrote:
Posting this back to the list, as the example I'm posting should go to the archives.


I applaud your stubbornness, and would like to say that your post was intriguing enough for me to wonder if I could do this easily.

So... over the weekend, I wrote more or less what you're talking about: a command-line C tool that can render to a signed-16bit buffer at 16khz.
The code posted at the bottom is essentially the simplest code I could think up for doing what you ask, it took me about 2.5 hours from start to finish to get it up and running, then I went outside because the weather was nice :).  Let me know if it works for you, and if you have any questions.
I agree that such an example may be useful to those who wish to keep to the lowest common denominator.  If you'd like the program to end a bit more gracefully than ctrl-c then you'll have to install a signal handler or some such that stops the main runloop.


_Mark

~~~~~~~~~~~

(snipped ... see previous email from Mark for the code he suggested.)

---
B. Mitchell Loebel, Executive Director                              408 425-9920

The Tech Startup Connection
(formerly The PARALLEL Processing Connection)

 _______________________________________________
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: Re: Sample times in input procs
  • Next by Date: Re: Streaming audio to built-in audio device
  • Previous by thread: Re: Streaming audio to built-in audio device
  • Next by thread: syncing core video with core audio
  • Index(es):
    • Date
    • Thread