Don't double-label voices whose name already carries the quality tier
Premium/enhanced voices ship with the tier in their name (e.g. "Ava (Premium)"), so appending "— Premium" produced "Ava (Premium) — Premium" in the voice picker. Move the label logic to SpeechSettings.displayLabel and skip the suffix when the name already contains the tier (still name-only for default voices). Deterministic string helper, unit-tested. Claude-Session: https://claude.ai/code/session_01BQcEWmAPA78338QuEwRkAh
This commit is contained in:
@@ -211,14 +211,6 @@ struct SettingsView: View {
|
||||
installedVoices.contains { $0.quality != .default }
|
||||
}
|
||||
|
||||
/// Most installed voices are default quality, so labeling every one "Default" is noise;
|
||||
/// name only for those, and call out the enhanced/premium ones that are worth choosing.
|
||||
private func voiceLabel(_ voice: AVSpeechSynthesisVoice) -> String {
|
||||
voice.quality == .default
|
||||
? voice.name
|
||||
: "\(voice.name) — \(SpeechSettings.qualityLabel(voice.quality))"
|
||||
}
|
||||
|
||||
/// All spoken-instruction controls. The voice and the speed/pitch/volume adjustments also
|
||||
/// govern the library exercise Speak button; only the toggle gates the automatic workout cue.
|
||||
@ViewBuilder
|
||||
@@ -233,7 +225,8 @@ struct SettingsView: View {
|
||||
Picker("Voice", selection: $speechVoiceIdentifier) {
|
||||
Text("Automatic").tag("")
|
||||
ForEach(installedVoices, id: \.identifier) { voice in
|
||||
Text(voiceLabel(voice)).tag(voice.identifier)
|
||||
Text(SpeechSettings.displayLabel(name: voice.name, quality: voice.quality))
|
||||
.tag(voice.identifier)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user