MCPcopy Create free account
hub / github.com/TanStack/ai / buildSpeechAdapter

Function buildSpeechAdapter

examples/ts-react-chat/src/lib/server-audio-adapters.ts:45–59  ·  view source on GitHub ↗
(provider: SpeechProviderId)

Source from the content-addressed store, hash-verified

43}
44
45export function buildSpeechAdapter(provider: SpeechProviderId): AnyTTSAdapter {
46 const config = findConfig(SPEECH_PROVIDERS, provider)
47 switch (config.id) {
48 case 'openai':
49 return openaiSpeech(config.model as 'tts-1')
50 case 'gemini':
51 return geminiSpeech(config.model as 'gemini-2.5-flash-preview-tts')
52 case 'fal':
53 return falSpeech(config.model)
54 case 'grok':
55 return grokSpeech(config.model as 'grok-tts')
56 case 'elevenlabs':
57 return elevenlabsSpeech(config.model as 'eleven_multilingual_v2')
58 }
59}
60
61export function buildTranscriptionAdapter(
62 provider: TranscriptionProviderId,

Callers 2

server-fns.tsFile · 0.90

Calls 6

openaiSpeechFunction · 0.90
geminiSpeechFunction · 0.90
falSpeechFunction · 0.90
grokSpeechFunction · 0.90
elevenlabsSpeechFunction · 0.90
findConfigFunction · 0.85

Tested by

no test coverage detected