MCPcopy Index your code
hub / github.com/simstudioai/sim / readTtsErrorJson

Function readTtsErrorJson

apps/sim/app/api/tools/tts/unified/route.ts:40–48  ·  view source on GitHub ↗
(
  response: Response,
  label: string
)

Source from the content-addressed store, hash-verified

38const MAX_TTS_JSON_BYTES = Math.ceil((MAX_TTS_AUDIO_BYTES * 4) / 3) + 256 * 1024
39
40async function readTtsErrorJson(
41 response: Response,
42 label: string
43): Promise<Record<string, unknown>> {
44 return readResponseJsonWithLimit<Record<string, unknown>>(response, {
45 maxBytes: MAX_TTS_ERROR_BYTES,
46 label,
47 }).catch(() => ({}))
48}
49
50function getTtsErrorMessage(error: Record<string, unknown>, fallback: string): string {
51 const nested = error.error

Callers 6

synthesizeWithOpenAiFunction · 0.85
synthesizeWithDeepgramFunction · 0.85
synthesizeWithElevenLabsFunction · 0.85
synthesizeWithCartesiaFunction · 0.85
synthesizeWithGoogleFunction · 0.85
synthesizeWithPlayHTFunction · 0.85

Calls 1

Tested by

no test coverage detected