-
Notifications
You must be signed in to change notification settings - Fork 68
Cannot get output balance of MacBook Pro M1 Speakers #59
Comments
I've copied some of the source code and trying it out in my app, looks like maybe it's throwing Does this mean newer macbooks don't expose the balance property for their speakers? This is likely terrible code, let me know if there's a better approach to debug! var masterBalanceAddress = AudioObjectPropertyAddress(mSelector: kAudioHardwareServiceDeviceProperty_VirtualMainBalance,
mScope: kAudioDevicePropertyScopeOutput,
mElement: kAudioObjectPropertyElementMain)
var deviceId: AudioObjectID = <put device id here>
var balanceValue: Float32 = 0
var size: UInt32 = UInt32(MemoryLayout<Float32>.size)
let result: OSStatus = AudioObjectGetPropertyData(deviceID, &masterBalanceAddress, UInt32(0), nil, &size, &balanceValue)
// Outputs status of 2003332927 which is `kCMIOHardwareUnknownPropertyError` |
@jamsinclair I don't have access to an M1 Mac right now, but it sounds like the built-in speakers output on your M1 Mac may not support setting this property. One way to confirm this is by opening Audio MIDI Setup (included with macOS) and check if the UI control for Balance is enabled for this device: |
@rnine Thanks! There's definitely enabled options to configure the balance for the system speakers in both the "Sound Preferences" and "Audio Midi Setup" GUIs. I would be happy to help debug further from my machine. Any ideas of CoreAudio properties or options I can play around with to get/set the balance? |
Problem
I am unable to retrieve the output balance for the builtin speakers on my M1 MacBook Pro.
Other devices, like external headphones, are able to retrieve the balance with no issues.
Specs:
Code in Use:
Notes
Feels like this might be an underlying apple issue or I am just doing something stupid 😅
Also so much ❤️ for this library. The Audio APIs are a real developer pain to work with. This will help simplify a bunch of code in my app.
The text was updated successfully, but these errors were encountered: