File size: 6,393 Bytes
ec79ef1
9cbfcc4
ec79ef1
9cbfcc4
 
 
 
ec79ef1
 
 
9cbfcc4
 
 
 
 
 
 
 
 
 
 
 
8f43e80
 
9cbfcc4
ec79ef1
9cbfcc4
ec79ef1
 
 
39d590a
9cbfcc4
39d590a
2aef696
8f43e80
39d590a
 
 
 
 
ec79ef1
39d590a
ec79ef1
 
 
39d590a
9cbfcc4
39d590a
8f43e80
 
39d590a
 
 
 
 
9cbfcc4
 
 
 
 
6585b54
9cbfcc4
6585b54
8f43e80
 
6585b54
 
 
 
 
ec79ef1
9cbfcc4
ec79ef1
 
 
 
9cbfcc4
 
 
 
 
8f43e80
 
9cbfcc4
ec79ef1
9cbfcc4
ec79ef1
 
 
 
9cbfcc4
8f43e80
 
 
 
9cbfcc4
8f43e80
 
9cbfcc4
 
 
 
 
 
 
 
 
 
8f43e80
9cbfcc4
 
 
 
 
 
8f43e80
 
 
 
ec79ef1
 
9cbfcc4
 
 
 
 
8f43e80
9cbfcc4
ec79ef1
 
9cbfcc4
 
 
8f43e80
9cbfcc4
8f43e80
 
ec79ef1
 
9cbfcc4
 
 
8f43e80
9cbfcc4
8f43e80
 
760438e
ec79ef1
 
 
 
 
 
 
 
 
 
9cbfcc4
ec79ef1
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
"""
Avatar profiles.

kokoro_voice  — Kokoro ONNX voice ID (primary, high quality)
kokoro_speed  — playback speed for Kokoro (1.0 = normal)
edge_voice    — edge-tts voice name (fallback or for accents Kokoro lacks)
rate / pitch  — edge-tts rate / pitch tweaks (fallback only)
"""

PROFILES: dict[str, dict] = {

    # ── React frontend avatars ────────────────────────────────────────────

    "lumi": {
        "id":           "lumi",
        "display_name": "Lumi",
        "label":        "Lumi · Your Guide",
        "portrait":     "lumi.png",
        "kokoro_voice": "af_sky",
        "kokoro_speed": 1.1,
        "edge_voice":   "en-US-JennyNeural",
        "rate":         "+5%",
        "pitch":        "+4Hz",
        "description":  "a bright, cheerful, and enthusiastic AI guide with a touch of anime-style energy",
        "voice": "af_sky", "speed": 1.1,
    },

    "dorothy": {
        "id":           "dorothy",
        "display_name": "Dorothy",
        "label":        "Dorothy · Very Elderly Black woman, 80",
        "portrait":     "dorothy.png",
        # Michelle (US) + Slow rate = Grandmotherly feel.
        "kokoro_voice": None,
        "kokoro_speed": 1.0,
        "edge_voice":   "en-US-MichelleNeural",
        "rate":         "-15%",
        "pitch":        "-3Hz",
        "description":  "a very wise, patient, and nurturing elderly woman with a slow, warm, and grandmotherly heart",
        "voice": "en-US-MichelleNeural", "speed": 1.0,
    },
 
    "harold": {
        "id":           "harold",
        "display_name": "Harold",
        "label":        "Harold · Very Elderly White man, 80",
        "portrait":     "harold.png",
        # Roger (US) is the most realistic "Grandfather" voice.
        "kokoro_voice": None,
        "kokoro_speed": 1.0,
        "edge_voice":   "en-US-RogerNeural",
        "rate":         "-15%",
        "pitch":        "-5Hz",
        "description":  "a very gentle, patient, and distinguished elderly gentleman with a slow, wise, and deep voice",
        "voice": "en-US-RogerNeural", "speed": 1.0,
    },

    "marcus": {
        "id":           "marcus",
        "display_name": "Marcus",
        "label":        "Marcus · Young Black man, 20",
        "portrait":     "marcus.png",
        # Steffan (US) + 10% rate = high energy Gen Z vibe.
        "kokoro_voice": None,
        "kokoro_speed": 1.0,
        "edge_voice":   "en-US-SteffanNeural",
        "rate":         "+10%",
        "pitch":        "+2Hz",
        "description":  "a warm, energetic Gen Z young man who is upbeat, uses a bit of modern friendly energy, and is very encouraging",
        "voice": "en-US-SteffanNeural", "speed": 1.0,
    },

    "priya": {
        "id":           "priya",
        "display_name": "Priya",
        "label":        "Priya · Young South Asian woman, 28",
        "portrait":     "priya.png",
        "kokoro_voice": None,
        "kokoro_speed": 1.0,
        "edge_voice":   "en-IN-NeerjaNeural",
        "rate":         "+3%",
        "pitch":        "+2Hz",
        "description":  "a warm, attentive, and bright young South Asian woman",
        "voice": "en-IN-NeerjaNeural", "speed": 1.0,
    },

    "carlos": {
        "id":           "carlos",
        "display_name": "Carlos",
        "label":        "Carlos · Middle-aged Latino man, 45",
        "portrait":     "carlos.png",
        "kokoro_voice": None,
        "kokoro_speed": 1.0,
        "edge_voice":   "en-US-ChristopherNeural",
        "rate":         "-2%",
        "pitch":        "-3Hz",
        "description":  "a knowledgeable, confident, and experienced advisor and mentor",
        "voice": "en-US-ChristopherNeural", "speed": 1.0,
    },

    # ── Additional Gradio UI profiles ─────────────────────────────────────

    "sophie": {
        "id": "sophie", "display_name": "Sophie",
        "label": "Sophie · Young White woman, 25",
        "portrait": "sophie.png",
        "kokoro_voice": "af_sarah", "kokoro_speed": 1.05,
        "edge_voice": "en-US-AriaNeural", "rate": "+3%", "pitch": "+3Hz",
        "description": "a bright, caring, and cheerful young woman",
        "voice": "af_sarah", "speed": 1.05,
    },
    "james": {
        "id": "james", "display_name": "James",
        "label": "James · Middle-aged White man, 45",
        "portrait": "james.png",
        "kokoro_voice": None, "kokoro_speed": 1.0,
        "edge_voice": "en-US-GuyNeural", "rate": "-2%", "pitch": "-3Hz",
        "description": "a calm, thoughtful, and reassuring man in his 40s",
        "voice": "en-US-GuyNeural", "speed": 1.0,
    },
    "mei": {
        "id": "mei", "display_name": "Mei",
        "label": "Mei · Young East Asian woman, 25",
        "portrait": "mei.png",
        "kokoro_voice": "af_nicole", "kokoro_speed": 1.05,
        "edge_voice": "en-US-JennyNeural", "rate": "+3%", "pitch": "+2Hz",
        "description": "a kind, gentle, and perceptive young woman",
        "voice": "af_nicole", "speed": 1.05,
    },
    "amara": {
        "id": "amara", "display_name": "Amara",
        "label": "Amara · Middle-aged Black woman, 45",
        "portrait": "amara.png",
        "kokoro_voice": "af_bella", "kokoro_speed": 0.95,
        "edge_voice": "en-US-MonicaNeural", "rate": "-3%", "pitch": "-2Hz",
        "description": "a strong, empathetic, and grounded woman",
        "voice": "af_bella", "speed": 0.95,
    },
    "liam": {
        "id": "liam", "display_name": "Liam",
        "label": "Liam · Young Irish man, 28",
        "portrait": "liam.png",
        "kokoro_voice": None, "kokoro_speed": 1.0,
        "edge_voice": "en-IE-ConnorNeural", "rate": "+2%", "pitch": "+0Hz",
        "description": "a cheerful, witty, and dependable young man",
        "voice": "en-IE-ConnorNeural", "speed": 1.0,
    },
}

DEFAULT_PROFILE_ID = "sophie"


def get_profile(profile_id: str) -> dict:
    return PROFILES.get(profile_id, PROFILES[DEFAULT_PROFILE_ID])


def profile_labels() -> list[str]:
    return [p["label"] for pid, p in PROFILES.items() if not pid.endswith("_gradio")]


def id_from_label(label: str) -> str:
    for pid, p in PROFILES.items():
        if p["label"] == label:
            return pid
    return DEFAULT_PROFILE_ID