mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-21 16:38:38 +00:00
fix(macos): guard voice audio paths with no input device (#25817)
Co-authored-by: Stefan Förster <103369858+sfo2001@users.noreply.github.com>
This commit is contained in:
@@ -53,6 +53,15 @@ final class AudioInputDeviceObserver {
|
||||
return output
|
||||
}
|
||||
|
||||
/// Returns true when the system default input device exists and is alive with input channels.
|
||||
/// Use this preflight before accessing `AVAudioEngine.inputNode` to avoid SIGABRT on Macs
|
||||
/// without a built-in microphone (Mac mini, Mac Pro, Mac Studio) or when an external mic
|
||||
/// is disconnected.
|
||||
static func hasUsableDefaultInputDevice() -> Bool {
|
||||
guard let uid = self.defaultInputDeviceUID() else { return false }
|
||||
return self.aliveInputDeviceUIDs().contains(uid)
|
||||
}
|
||||
|
||||
static func defaultInputDeviceSummary() -> String {
|
||||
let systemObject = AudioObjectID(kAudioObjectSystemObject)
|
||||
var address = AudioObjectPropertyAddress(
|
||||
|
||||
Reference in New Issue
Block a user