Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: what would cause QTSetComponentProperty to fail with a kAudioUnitErr_InvalidPropertyValue err?




On Mar 9, 2007, at 4:09 PM, Michael Dautermann wrote:

Hi all,

The answer to this should be staring me in the face but it's escaping my notice.

I'm putting together a new Audio Hardware plugin. I'm very thankful for the JackRouter project (THANKS Stéphane!) but oh how I wish there were more sample code & projects to rely on.

Under DeviceGetPropertyInfo, I set the size of the kAudioDevicePropertyDeviceUID property to CFStringRef and for DeviceGetProperty, I'm returning my device uid properly using:

*outString = CFStringCreateWithCString(kCFAllocatorDefault, "MyNiftyDevice:0", CFStringGetSystemEncoding());

I can see these properties and the UID of my plugin just fine when I examine it under HALLabs.

But when I try to set the Sequence Grabber in my application to pick it up (via QTSetComponentProperty, using the same format as WhackedTV):

err = [self setPropertyWithClass: kQTPropertyClass_SGAudioRecordDevice id: kQTSGAudioPropertyID_DeviceUID size: sizeof(uid) address: &uid];

this fails with a kAudioUnitErr_InvalidPropertyValue.

Does your device have input streams? Setting the above property will fail if the device is not capable of capturing audio. The Sequence Grabber determines this by querying it for its streams on the input side.



Anyone have any ideas off the top of their head what I might be missing?







p.s. as an aside, WhackedTV passes an NSString in for the UID and that NSString's "sizeof" byte count doesn't match the byte count for the [ NSString length ]. Should I be surprised this works for Apple sample code?

NSStrings are toll free bridged to CFStringRefs. WhackedTV is correct. The size to pass is the sizeof(NSString*), which is the same as sizeof(CFStringRef). It's not the number of unichars in the string.


-Brad Ford
QuickTime Engineering




 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/coreaudio-api/email@hidden

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: http://lists.apple.com/mailman/options/coreaudio-api/email@hidden

This email sent to email@hidden
References: 
 >what would cause QTSetComponentProperty to fail with a kAudioUnitErr_InvalidPropertyValue err? (From: Michael Dautermann <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.