Hi!

That’s probably not it, but just in case: have you specified the rest of the 
propertyAdress struct:

propertyAddress.mSelector = kAudioDevicePropertyDeviceNameCFString;
propertyAddress.mScope = 0;
propertyAddress.mElement = 0;

?

Cheers,
Sebastian

> Am 12.05.2015 um 07:03 schrieb Dodo <[email protected] 
> <mailto:[email protected]>>:
> 
> If you have already received this email, just discard it and accept my 
> apologies.
> 
> Hi,
> 
> I’m having a trouble to run a routine that retrieves the input and output 
> devices.
> 
> Specifically, if I compile the routine with the following command: 
> 
> g++ -arch i386  -fPIC -c -Wall -o device_list.o device_list.cpp
> g++ -arch i386  -framework AudioUnit -framework CoreAudio -framework 
> CoreFoundation -framework AudioToolbox -I/usr/local/include \
>       -o device_list.exe device_list_main.cpp device_list.o
> 
> everything works fine, but if I compile this very source with a project that 
> does not use the “-arch i386” option, the binary starts but doesn’t work fine.
> More precisely, in the following snippet, the status is fine but the 
> deviceName is NULL:
> 
> CFStringRef deviceName = NULL;
> dataSize = sizeof(deviceName);
> propertyAddress.mSelector = kAudioDevicePropertyDeviceNameCFString;
> status = AudioObjectGetPropertyData(audioDevices[i], &propertyAddress, 0, 
> NULL, &dataSize, &deviceName);
> if(kAudioHardwareNoError != status) {
>    fprintf(stderr, "AudioObjectGetPropertyData 
> (kAudioDevicePropertyDeviceNameCFString) failed: %i\n", status);
>    continue;
> }
> 
> More, the project in which I need to compile this routine with, has been 
> compiled without the “-arch i386” option.
> 
> 
> I’m using OS X 10.10.3 
> and
> g++ Apple LLVM version 6.1.0 (clang-602.0.49) (based on LLVM 3.6.0svn)
> Target: x86_64-apple-darwin14.3.0
> Thread model: posix
> 
> 
> Thanx in advance.
> 
> Cheers
> 
> Dodo
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Coreaudio-api mailing list      ([email protected] 
> <mailto:[email protected]>)
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/coreaudio-api/sebastianmorsch%40mac.com
>  
> <https://lists.apple.com/mailman/options/coreaudio-api/sebastianmorsch%40mac.com>
> 
> This email sent to [email protected]

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/coreaudio-api/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to