Setting the device volume
Setting the device volume
- Subject: Setting the device volume
- From: patrick machielse <email@hidden>
- Date: Thu, 11 Nov 2004 16:20:42 +0100
Another beginner's question:
I'm trying to manipulate the volume of the audio I'm playing. As a
first step I want to know the current device volume. I use the
following code to find out the volume setting:
Float32 the_volume;
UInt32 the_size = sizeof the_volume;
OSStatus err;
err = AudioDeviceGetProperty(device,
0,
true,
kAudioDevicePropertyVolumeScalar,
&the_size,
&the_volume);
if ( err != kAudioHardwareNoError ) {
NSString *errStr = [NSString stringWithCString:(const char *)&err
length:4];
NSLog(@"get kAudioDevicePropertyVolumeScalar error \'%@\'", errStr);
}
However, this always returns an error 'who?'
(kAudioHardwareUnknownPropertyError)
I must be missing something obvious, but it's not obvious to me...
TIA,
Patrick
_______________________________________________
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