Getting output device volume level
Getting output device volume level
- Subject: Getting output device volume level
- From: "Bernery Philippe" <email@hidden>
- Date: Fri, 31 Mar 2006 16:22:42 +0200
Hi,
I am trying volume info from devices. The following code works for input devices but does not work for output devices (the returned satus id bad). Obviously I replaced TRUE by FALSE to get output information.
Is the device not the same for input and output device ? Or... what's wrong ?
===============
OSStatus status = noErr;
UInt32 size = 0;
Float32 volume = 0.0;
char deviceName[1024];
size = sizeof(deviceName);
status = AudioDeviceGetProperty(deviceList->list[i], 0, TRUE, kAudioDevicePropertyDeviceName, &size, deviceName);
if (status) {
fprintf(stderr, "Can't get device property: kAudioDevicePropertyDeviceName");
}
size = sizeof(volume);
status = AudioDeviceGetProperty(deviceList->list[i], 0,
TRUE, kAudioDevicePropertyVolumeScalar, &size, &volume);
if (status) {
fprintf(stderr, "Can't get device property: kAudioDevicePropertyVolumeScalar");
}
printf("Current volume: %f", volume);
===============
Thank you for your help.
--
Philippe BERNERY
_______________________________________________
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