• 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
aggregate device
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

aggregate device


  • Subject: aggregate device
  • From: "Christoph Teschner" <email@hidden>
  • Date: Sat, 15 Apr 2006 04:00:48 +0200

Hi,

I have been trying to create an aggregate following the steps I have read from previous posts. After having located the base plug-in, I create a cfdictionary representing the aggregate, however, when I tell the base plug in to create the aggregate with kAudioPlugInCreateAggregateDevice in AudioObjectGetPropertyData I get an Error.
I've put some sample code below in which I try to create an aggregate. Since, I wasn't able to find much documentation for this, I'd really appreciate any further help on this issue or if someone can see what I'm missing and/or doing wrong in my code.


thanks so much in advance,
christoph

// 1. locate the base plug-in using ...

	UInt32 theSize;
	AudioValueTranslation theTranslation;
	CFStringRef theCFString;
	AudioDeviceID theID; // necessary for further programming

theCFString = CFStringCreateWithCString(NULL,"com.apple.audio.CoreAudio",kCFStringEncodingUTF8);

theTranslation.mInputData = &theCFString;
theTranslation.mInputDataSize = sizeof(CFStringRef);
theTranslation.mOutputData = &theID;
theTranslation.mOutputDataSize = sizeof(AudioDeviceID);
theSize = sizeof(AudioValueTranslation);
result = AudioHardwareGetProperty ( kAudioHardwarePropertyPlugInForBundleID, &theSize,
&theTranslation );



// 2. Create a CFDictionary that describes the aggregate device you want to create...
// the keys are in <CoreAudio/AudioHardware.h> -> unique UID



// For testing purposes I only use the built-in as the only subdevice

CFMutableDictionaryRef newDictionary = CFDictionaryCreateMutable(kCFAllocatorDefault,0, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);

CFDictionarySetValue(newDictionary, CFSTR( "uid" ),CFSTR( "ExampleAggregate" ));
CFDictionarySetValue(newDictionary, CFSTR( "name" ),CFSTR( "ExampleAggregate" ));


CFMutableArrayRef newArray = CFArrayCreateMutable(NULL,0,NULL);
CFMutableDictionaryRef subdevice1;
result = AudioDeviceGetProperty(builtInDeviceId,0,NO, kAudioAggregateDevicePropertyComposition, & ioPropertyDataSize,& subdevice1);
CFArrayAppendValue(newArray,subdevice1);
CFDictionarySetValue(newDictionary, CFSTR( "subdevices" ), newArray);



// 3. Tell the base plug-in to create the aggregate device using // kAudioPlugInCreateAggregateDevice.

	UInt32 outDataSize;

	AudioObjectPropertyAddress theAddress;
	theAddress.mSelector = kAudioPlugInCreateAggregateDevice;
	theAddress.mScope = kAudioObjectPropertyScopeGlobal;
	theAddress.mElement = kAudioObjectPropertyElementMaster;

result = AudioObjectGetPropertyDataSize(theID, &theAddress, 0, NULL, &outDataSize);

	AudioObjectID theNewPsoidoID;

//UInt32 inQualifierDataSize = 0; //do I actually have to provide the size here? I could not find any function to retrieve the size of CFDictionaryRef

result = AudioObjectGetPropertyData(theID, &theAddress, 0, &myDict, &outDataSize, &theNewPsoidoID); // this fails


_______________________________________________ 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
  • Follow-Ups:
    • Re: aggregate device
      • From: Jeff Moore <email@hidden>
  • Prev by Date: Re: Streaming Graph to file
  • Next by Date: PlayFile to file stream
  • Previous by thread: Re: Streaming Graph to file
  • Next by thread: Re: aggregate device
  • Index(es):
    • Date
    • Thread