I've been searching the documentation, mailing lists on and off for a couple of days but can't seem to find the answer to this.
I've got an OS X app that, amongst other things, queries the available hardware devices and their current volumes using kAudioDevicePropertyVolumeScalar and friends.
What I want to be able to do is get and set the -alert- volume (?) for the system output device represented by kAudioHardwarePropertyDefaultSystemOutputDevice rather than that devices volume.
To clarify from my limited understand, this is the volume setting users can adjust in System Preferences under 'Play sound effects through'.
Searching the coreaudio-api lists, I've managed to glean that this volume setting is not a device property but some kind of derived value, but I'm stumped as to where to from here.
Any help would be gratefully received.
I am not sure if you really have a requirement for reading it through CoreAudio, but the following works just fine:
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
[defaults addSuiteNamed:@"com.apple.systemsound"];
NSLog(@"%f", [defaults floatForKey:@"com.apple.sound.beep.volume"]);
Though this might change with operating system updates as the settings are stored in ~/Library/Preferences/com.apple.systemsound.plist
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With