Re: Getting output device volume level
Re: Getting output device volume level
- Subject: Re: Getting output device volume level
- From: William Stewart <email@hidden>
- Date: Fri, 31 Mar 2006 13:04:17 -0800
Which device is this failing for?
If you have a look in HAL Lab you can see that some devices don't
have input, some don't have output, and some don't have this control
implemented on the device (for instance, for builtin hardware this is
implemented for each of its two channels)
On 31/03/2006, at 6:22 AM, Bernery Philippe wrote:
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);
You should use this:
kAudioDevicePropertyDeviceNameCFString
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
--
mailto:email@hidden
tel: +1 408 974 4056
________________________________________________________________________
__
"Much human ingenuity has gone into finding the ultimate Before.
The current state of knowledge can be summarized thus:
In the beginning, there was nothing, which exploded" - Terry Pratchett
________________________________________________________________________
__
_______________________________________________
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