Skip to content

A tiny friend in your Mac's notch and on your iPhone that keeps an eye on your AI coding agents: Claude Code, Codex, Cursor, Gemini CLI, Antigravity and more. Approve from the notch or your Lock Screen.

voice: Woman / Man for the Mac voice, Premium voices first

Claudef3989b5013b9
diff --git a/NotchBuddy/Resources/Localizable.xcstrings b/NotchBuddy/Resources/Localizable.xcstrings
index 797533bc..b9bc16f3 100644
--- a/NotchBuddy/Resources/Localizable.xcstrings
+++ b/NotchBuddy/Resources/Localizable.xcstrings
@@ -25686,6 +25686,201 @@
}
}
}
+ },
+ "voice.mac-voice-current %@": {
+ "extractionState": "manual",
+ "localizations": {
+ "ar": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "الصوت المستخدم: %@"
+ }
+ },
+ "bn": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "ব্যবহৃত কণ্ঠ: %@"
+ }
+ },
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Voice in use: %@"
+ }
+ },
+ "es": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Voz en uso: %@"
+ }
+ },
+ "fr": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Voix utilisée : %@"
+ }
+ },
+ "hi": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "उपयोग में आवाज़: %@"
+ }
+ },
+ "id": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Suara yang dipakai: %@"
+ }
+ },
+ "pt-BR": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Voz em uso: %@"
+ }
+ },
+ "ru": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Используется голос: %@"
+ }
+ },
+ "zh-Hans": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "当前声音:%@"
+ }
+ }
+ }
+ },
+ "voice.mac-voices-help": {
+ "extractionState": "manual",
+ "localizations": {
+ "ar": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "لصوت أكثر طبيعية، نزّل صوتًا Premium: إعدادات النظام ← تسهيلات الاستخدام ← المحتوى المنطوق ← صوت النظام ← إدارة الأصوات. بالإنجليزية: Ava لامرأة، Jamie لرجل (بريطاني)."
+ }
+ },
+ "bn": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "আরও স্বাভাবিক কণ্ঠের জন্য একটি Premium কণ্ঠ ডাউনলোড করো: System Settings → Accessibility → Spoken Content → System Voice → Manage Voices। ইংরেজিতে: নারী হলে Ava, পুরুষ হলে Jamie (ব্রিটিশ)।"
+ }
+ },
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "For a more natural voice, download a Premium voice: System Settings → Accessibility → Spoken Content → System Voice → Manage Voices. In English: Ava for a woman, Jamie for a man (British)."
+ }
+ },
+ "es": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Para una voz más natural, descarga una voz Premium: Ajustes del Sistema → Accesibilidad → Contenido leído → Voz del sistema → Gestionar voces. En inglés: Ava para mujer, Jamie para hombre (británico)."
+ }
+ },
+ "fr": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Pour une voix plus naturelle, télécharge une voix Premium : Réglages Système → Accessibilité → Contenu énoncé → Voix du système → Gérer les voix. En anglais : Ava pour une femme, Jamie pour un homme (britannique)."
+ }
+ },
+ "hi": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "ज़्यादा स्वाभाविक आवाज़ के लिए Premium आवाज़ डाउनलोड करें: System Settings → Accessibility → Spoken Content → System Voice → Manage Voices। अंग्रेज़ी में: महिला के लिए Ava, पुरुष के लिए Jamie (ब्रिटिश)।"
+ }
+ },
+ "id": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Untuk suara yang lebih alami, unduh suara Premium: Pengaturan Sistem → Aksesibilitas → Konten Lisan → Suara Sistem → Kelola Suara. Bahasa Inggris: Ava untuk wanita, Jamie untuk pria (Inggris)."
+ }
+ },
+ "pt-BR": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Para uma voz mais natural, baixe uma voz Premium: Ajustes do Sistema → Acessibilidade → Conteúdo Falado → Voz do Sistema → Gerenciar Vozes. Em inglês: Ava para mulher, Jamie para homem (britânico)."
+ }
+ },
+ "ru": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Для более естественного голоса скачай голос Premium: Системные настройки → Универсальный доступ → Устная речь → Системный голос → Управлять голосами. По-английски: Ava — женский, Jamie — мужской (британский)."
+ }
+ },
+ "zh-Hans": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "想要更自然的声音,请下载 Premium 语音:系统设置 → 辅助功能 → 朗读内容 → 系统语音 → 管理语音。英语:女声选 Ava,男声选 Jamie(英式)。"
+ }
+ }
+ }
+ },
+ "voice.mac-voices-open": {
+ "extractionState": "manual",
+ "localizations": {
+ "ar": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "افتح تسهيلات الاستخدام"
+ }
+ },
+ "bn": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Accessibility খোলো"
+ }
+ },
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Open Accessibility settings"
+ }
+ },
+ "es": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Abrir Accesibilidad"
+ }
+ },
+ "fr": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Ouvrir Accessibilité"
+ }
+ },
+ "hi": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Accessibility खोलें"
+ }
+ },
+ "id": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Buka Aksesibilitas"
+ }
+ },
+ "pt-BR": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Abrir Acessibilidade"
+ }
+ },
+ "ru": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Открыть Универсальный доступ"
+ }
+ },
+ "zh-Hans": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "打开辅助功能"
+ }
+ }
+ }
}
},
"version": "1.0"
diff --git a/NotchBuddy/Sources/App/SettingsView.swift b/NotchBuddy/Sources/App/SettingsView.swift
index 02cf5ef5..ed4c4f93 100644
--- a/NotchBuddy/Sources/App/SettingsView.swift
+++ b/NotchBuddy/Sources/App/SettingsView.swift
@@ -1315,13 +1315,31 @@ struct SettingsView: View {
ElevenLabsTTS.shared.reset()
}
}
- Picker(String(localized: "voice.tts-gender"), selection: $elevenGender) {
- Text(String(localized: "voice.tts-female")).tag("female")
- Text(String(localized: "voice.tts-male")).tag("male")
+ }
+
+ Picker(String(localized: "voice.tts-gender"), selection: $elevenGender) {
+ Text(String(localized: "voice.tts-female")).tag("female")
+ Text(String(localized: "voice.tts-male")).tag("male")
+ }
+ .pickerStyle(.segmented)
+ .frame(maxWidth: 220)
+ .onChange(of: elevenGender) { _, _ in ElevenLabsTTS.shared.reset() }
+
+ if ttsEngine == "system" {
+ let current = VoiceSpeaker.macVoiceName(for: Locale(identifier: voiceLanguage == "fr" ? "fr-FR" : "en-US"),
+ gender: elevenGender)
+ Text(String(format: String(localized: "voice.mac-voice-current %@"), current))
+ .font(.system(size: 11))
+ .foregroundColor(.secondary)
+ Text(String(localized: "voice.mac-voices-help"))
+ .font(.system(size: 11))
+ .foregroundColor(.secondary)
+ .fixedSize(horizontal: false, vertical: true)
+ Button(String(localized: "voice.mac-voices-open")) {
+ if let url = URL(string: "x-apple.systempreferences:com.apple.Accessibility-Settings.extension") {
+ NSWorkspace.shared.open(url)
+ }
}
- .pickerStyle(.segmented)
- .frame(maxWidth: 220)
- .onChange(of: elevenGender) { _, _ in ElevenLabsTTS.shared.reset() }
}
Button(String(localized: "voice.tts-test")) {
diff --git a/NotchBuddy/Sources/App/Voice/VoiceSpeaker.swift b/NotchBuddy/Sources/App/Voice/VoiceSpeaker.swift
index a91739e8..8a484f9a 100644
--- a/NotchBuddy/Sources/App/Voice/VoiceSpeaker.swift
+++ b/NotchBuddy/Sources/App/Voice/VoiceSpeaker.swift
@@ -103,7 +103,7 @@ final class VoiceSpeaker: NSObject, AVSpeechSynthesizerDelegate, AVAudioPlayerDe
let utt = AVSpeechUtterance(string: text)
utt.pitchMultiplier = 1.15
utt.rate = AVSpeechUtteranceDefaultSpeechRate * 1.1
- utt.voice = _bestVoice(for: locale)
+ utt.voice = Self.bestVoice(for: locale, gender: VoiceSettings.elevenGender)
currentUtterance = utt
synth.speak(utt)
}
@@ -124,15 +124,15 @@ final class VoiceSpeaker: NSObject, AVSpeechSynthesizerDelegate, AVAudioPlayerDe
}
}
- /// Picks the best installed voice for the spoken locale: same region first
- /// (en-US before en-GB), then quality (.premium > .enhanced > default).
- /// Novelty voices and the user's Personal Voice are never used.
- private func _bestVoice(for locale: Locale?) -> AVSpeechSynthesisVoice? {
+ /// Best installed Mac voice for the language and the chosen gender (Settings → Voice):
+ /// quality first (.premium > .enhanced > default — Ava Premium beats a compact US voice),
+ /// then same region. Novelty voices and the user's Personal Voice are never used.
+ /// Falls back to any gender when none of the chosen one is installed.
+ static func bestVoice(for locale: Locale?, gender: String) -> AVSpeechSynthesisVoice? {
guard let loc = locale else { return nil }
let lang = loc.language.languageCode?.identifier ?? ""
guard !lang.isEmpty else { return nil }
- let region = loc.region?.identifier
- let exact = region.map { "\(lang)-\($0)" }
+ let exact = loc.region.map { "\(lang)-\($0.identifier)" }
let voices = AVSpeechSynthesisVoice.speechVoices().filter { v in
(v.language == lang || v.language.hasPrefix(lang + "-"))
@@ -140,11 +140,23 @@ final class VoiceSpeaker: NSObject, AVSpeechSynthesizerDelegate, AVAudioPlayerDe
&& !v.voiceTraits.contains(.isPersonalVoice)
}
guard !voices.isEmpty else { return AVSpeechSynthesisVoice(language: exact ?? lang) }
+ let wanted: AVSpeechSynthesisVoiceGender = gender == "male" ? .male : .female
+ let pool = voices.contains { $0.gender == wanted } ? voices.filter { $0.gender == wanted } : voices
func rank(_ v: AVSpeechSynthesisVoice) -> (Int, Int) {
- (v.language == exact ? 1 : 0, v.quality.rawValue)
+ (v.quality.rawValue, v.language == exact ? 1 : 0)
+ }
+ return pool.max { rank($0) < rank($1) }
+ }
+
+ /// "Ava (Premium)" — shown in Settings so it is clear which voice Coucou uses.
+ static func macVoiceName(for locale: Locale, gender: String) -> String {
+ guard let v = bestVoice(for: locale, gender: gender) else { return "—" }
+ switch v.quality {
+ case .premium: return "\(v.name) (Premium)"
+ case .enhanced: return "\(v.name) (Enhanced)"
+ default: return v.name
}
- return voices.max { rank($0) < rank($1) }
}
// MARK: - AVSpeechSynthesizerDelegate