Archived
- Voices.swift: 13 Azure voices, default en-US-Ava - SettingsStore: persist voiceID/modelID, fallback to default voice - VoiceSession: sync set_voice/set_model on agent_ready, selectVoice/selectModel, track models + model_changed - SettingsView: voice and model picker sheets - ControlChannel: publish via publish(data:) reliable data channel instead of sendText DataStream (agent listens on legacy data_received; DataStream text was dropped)
35 lines
1.3 KiB
Swift
35 lines
1.3 KiB
Swift
import Foundation
|
|
|
|
struct VoiceOption: Equatable {
|
|
let id: String
|
|
let name: String
|
|
let tag: String?
|
|
|
|
var displayName: String {
|
|
tag.map { "\(name) (\($0))" } ?? name
|
|
}
|
|
}
|
|
|
|
enum Voices {
|
|
static let all: [VoiceOption] = [
|
|
VoiceOption(id: "en-US-Ava:DragonHDOmniLatestNeural", name: "Ava", tag: "Dragon HD Omni"),
|
|
VoiceOption(id: "en-US-JennyNeural", name: "Jenny", tag: nil),
|
|
VoiceOption(id: "en-US-GuyNeural", name: "Guy", tag: nil),
|
|
VoiceOption(id: "en-US-AndrewNeural", name: "Andrew", tag: nil),
|
|
VoiceOption(id: "en-US-AriaNeural", name: "Aria", tag: nil),
|
|
VoiceOption(id: "en-US-EmmaNeural", name: "Emma", tag: nil),
|
|
VoiceOption(id: "en-US-EricNeural", name: "Eric", tag: nil),
|
|
VoiceOption(id: "en-US-BrianNeural", name: "Brian", tag: nil),
|
|
VoiceOption(id: "en-US-AshleyNeural", name: "Ashley", tag: nil),
|
|
VoiceOption(id: "en-US-RichardNeural", name: "Richard", tag: nil),
|
|
VoiceOption(id: "en-US-TinaNeural", name: "Tina", tag: nil),
|
|
VoiceOption(id: "en-US-SteffanNeural", name: "Steffan", tag: nil),
|
|
]
|
|
|
|
static var defaultID: String { all[0].id }
|
|
|
|
static func display(for id: String) -> String? {
|
|
all.first { $0.id == id }?.displayName
|
|
}
|
|
}
|