forked from BasedHardware/omi
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRealtimeHubSessionVoiceConfig.swift
More file actions
27 lines (23 loc) · 1.14 KB
/
Copy pathRealtimeHubSessionVoiceConfig.swift
File metadata and controls
27 lines (23 loc) · 1.14 KB
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
import Foundation
extension RealtimeHubSession {
// MARK: - Voice-bearing payload fragments (production seams)
//
// These are the exact fragments the session builders embed, exposed so a
// regression test asserts the payload a real session is configured with —
// a per-call-site voice string drifting back in (marin) fails the test.
/// The OpenAI `session.update` output-audio block. cedar: the deep, calm
/// male voice of the gpt-realtime family, Charon's counterpart, so a
/// provider failover does not change who Omi sounds like mid-conversation.
static func openAIOutputAudioConfig() -> [String: Any] {
[
"format": ["type": "audio/pcm", "rate": 24000],
"voice": RealtimeHubVoicePolicy.voiceName(for: .openai),
]
}
/// The Gemini `setup.generationConfig.speechConfig` block. Pin the spoken
/// voice — with no speechConfig Gemini picks its own default, which differs
/// from the OpenAI hub voice and can change across model revisions.
static func geminiSpeechConfig() -> [String: Any] {
["voiceConfig": ["prebuiltVoiceConfig": ["voiceName": RealtimeHubVoicePolicy.voiceName(for: .gemini)]]]
}
}