Re: SimplePlayThru moved?
Re: SimplePlayThru moved?
- Subject: Re: SimplePlayThru moved?
- From: Chris Adamson <email@hidden>
- Date: Fri, 30 Jul 2010 10:57:20 -0400
I finally found a copy of SimplePlayThru as a .sit (really!) at < http://www.musicednet.com/downloads/SimplePlayThru.sit>. It exhibits exactly the problem that Doug warned about, namely that it requires that you're using an audio device that is both input- and output-capable.
//Checks to see if the play thru device is valid for this sample code //a valid device has both input and output for the "simple" case
if((mInputDevice ==0) || (mOutputDevice==0)){ size = sizeof(AudioDeviceID);
err = AudioHardwareGetProperty(kAudioHardwarePropertyDefaultInputDevice, &size, &mInputDevice); err = AudioHardwareGetProperty(kAudioHardwarePropertyDefaultOutputDevice, &size, &mOutputDevice); }
//Must be the same device! if( mOutputDevice == mInputDevice) ...
On my Power Mac, which doesn't have a single "built-in audio" device providing both input and output, this results in an error alert.
I did get it working with a Griffin iMic, which is a single device that provides both input and output. Still, point taken that this approach isn't practical for modern hardware.
I'm going to assume that this explains why the SimplePlayThru example is no longer on apple.com. Assuming this is the case, I'm going to file a bug report against documentation to say that the references to this example should be removed from TN2091 and the Core Audio Overview.
And then I guess I'll go back to the crushing disappointment of just how intimidating CAPlayThrough is.
--Chris
On Jul 29, 2010, at 4:40 PM, Chris Adamson wrote: And, apropos of the original subject, was the SimplePlayThru example removed from the developer.apple.com site at some point? On Jul 29, 2010, at 11:58 AM, Doug Wyatt wrote: Some desktop machines have a single input/output audio device for built-in. Many don't. You can't assume one way or the other.
You might play around with Audio MIDI Setup's audio windows -- it's built using the same public API's that you can use.
You'll need an AUHAL instance per device.
An alternative is to aggregate the built-in input and output devices, though that has its tradeoffs... (for starters, you'd have to force the two hardware sample rates to match)
|
_______________________________________________
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