• 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: Andrew Barnert <email@hidden>
  • Date: Sat, 5 May 2007 14:25:39 -0700

On 4 May 2007, at 15:17, B. Mitchell Loebel wrote:

Hello Mark:

Thank you.  Permit me to structure my question better:

I write C. I do not write Objective C or C++.

I've never met a decent C programmer who can't follow simple C++ or ObjC samples; you don't have to be able to write those languages to use the ideas (this isn't like BeOS, where vtable details are part of the ABI so you have to write C++).

One of the problems I have with Mac programming is that it seems as if the Apple coding modality is for me to fully describe my sound source and then they want to "pull" my data from my source, e.g. file or buffer. That means I have to go through a large learning curve to understand their nomenclature. I don't have the time or desire to go through that task.

If your problem is not with the basic model of CoreAudio, but with the fact that the API looks complicated--well, maybe Apple could do a better job making trivial tasks doable with less of a learning curve. You may want to look at JACK (http://jackaudio.org), which is every bit as complicated as CoreAudio, but you can jump right in and write really simple clients without learning much of it. Of course your users will have to be willing to install the JACK server, but that's not a big deal.


If your problem is with the basic pull model, then I don't know what to say except that you don't know what you want.

I simple want to know the API to the Apple D/A which connects to their built-in speakers so that I can "push" my PCM samples of a given width (16 bits) and at a specific sample rate 16Ksamples/sec ...

At the lowest level, the D/A is probably not running at 16K. That means resampling--and, worse, it means your code has to be driven by a timer at the D/A's frequency, even if that's otherwise inappropriate. The D/A also may not have the same endianness as your CPU. More importantly, each model may have a different D/A chip--and, once you've written your code to work with a half-dozen different chips, someone will want to use it with their USB speakers or Bluetooth headphones or pro audio adapter.


Also, keep in mind that OS X is a protected, multitasking OS. What happens if another process wants to play audio at the same time? CoreAudio mixes them on the fly (and also applies the user's volume, balance, and other settings), which would be impossible if it gave you direct ownership of the hardware.

A push model wouldn't be any lower level if it handled all of these details; it would just be a more difficult way of doing the same thing. There's a reason Steinberg wrote ASIO on top of Win95 and classic Mac OS, and there's a reason people use JACK on linux: you want CoreAudio, or something very much like it.

no more, no less. In essence then, I need to cut through all the Apple whistles and bells to work at a low level of code. I did check the reference you suggested carefully and I didn't see anything that fit the problem I described above. Ideas please ?????

If you really do want direct ownership of the hardware, you can write a driver. That gives you a much lower-level API. But I doubt that's what you want.


At 01:54 PM 5/4/2007 -0700, Mark Pauley wrote:
Have you taken a look at

http://developer.apple.com/documentation/MusicAudio/Conceptual/ CoreAudioOverview/index.html

?

_Mark

On May 4, 2007, at 1:34 PM, B. Mitchell Loebel wrote:

Hello:

I have an app that creates a PCM stream. Where can I find the API
(and perhaps some examples) to interface with the built-in D/A to
send my audio to the built-in speakers please?

---
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:
40mac.com


This email sent to email@hidden

---
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:
40yahoo.com


This email sent to email@hidden

_______________________________________________ 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
References: 
 >Streaming audio to built-in audio device (From: "B. Mitchell Loebel" <email@hidden>)
 >Re: Streaming audio to built-in audio device (From: Mark Pauley <email@hidden>)
 >Re: Streaming audio to built-in audio device (From: "B. Mitchell Loebel" <email@hidden>)

  • Prev by Date: Re: Streaming audio to built-in audio device
  • Next by Date: Sample times in input procs
  • Previous by thread: Re: Streaming audio to built-in audio device
  • Next by thread: Re: Streaming audio to built-in audio device
  • Index(es):
    • Date
    • Thread