Re: Changing Default Device and Sample Rate via Objective C
Re: Changing Default Device and Sample Rate via Objective C
- Subject: Re: Changing Default Device and Sample Rate via Objective C
- From: Chris Adamson <email@hidden>
- Date: Tue, 02 Oct 2012 09:06:19 -0400
Yeah, the PublicUtility situation is fugly. It's like playing whack-a-mole with sample code. Here's where I think you need to look:
* Xcode 4.5: Provided as a sample code project called "Core Audio Utility Classes" in the OS X 10.8 doc set (search the documentation in the Xcode Organizer). Instead of opening as a project like most sample code, this just copies a "Core Audio" folder over to ~/Downloads, along with a README that says to install it in /Library/Developer. OK, then.
* Xcode 4.3-4.4: Provided as part of the "Audio Tools for Xcode" download. In Xcode, use the menu item Xcode -> Open Developer Tool -> More Developer Tools. This opens your browser, goes to the developer downloads (you may have to log in) and searches for "for Xcode". Look for any "Audio Tools for Xcode" *earlier* than July 2012, since after that point it won't have the CoreAudio classes, just AU Lab and HAL Lab.
* Xcode 4.2 or older: Automatically installed into /Developer/Extras/CoreAudio as part of the Xcode install process.
--Chris
On Oct 2, 2012, at 8:33 AM, "email@hidden" <email@hidden> wrote:
> Thanks Rene. I already started down that road but I have had some difficulty. CAPlayThrough won't compile because it is missing all the PublicUtility files. I figured this was because Apple no longer puts them in "Library/Developer/Core Audio" but even after placing the files in there it doesn't work. I am new to XCode so I'm not sure how to change the path that it is looking for these files in. After digging around for a bit, I couldn't figure it out and started looking for another example. It is funny because most of the example code I find is either Deprecated or it won't compile for some other reason (even Apple's own examples). Very frustrating for a new Apple developer.
>
> Mike
>
> On Oct 2, 2012, at 3:23 AM, René J.V. Bertin wrote:
>
>> For changing only the sample rate of a hardware output device, use AudioDeviceSetProperty with kAudioDevicePropertyNominalSampleRate . I think that API was maybe not even used in the example I pointed you to, I remember that my first attempts to change the output rate were met with permissions errors. Sorry about that, I should have pointed you to CAPlayThrough.
>>
>> R.
>>
>> On Oct 01, 2012, at 16:44, email@hidden wrote:
>>
>>>> You're not obliged at all to use ObjC as the API for what you're asking is C++ - at least concerning the sample rate changing. I've never felt the need to change the default output device, so I cannot comment on that.
>>>> Have a look at the DefaultOutputUnit example, it's what I used to write my sample rate plugin for iTunes.
>>>>
>>>> René
>>>
>>> DefaultOutputUnit appears to be deprecated:
>>
>
>
> _______________________________________________
> 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
_______________________________________________
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