{"record":{"id":"62340f9896dbaa2e","repo":"decolua/9router","slug":"mimo-tts-returned-no-audio","errorCode":null,"errorMessage":"MiMo TTS returned no audio","messagePattern":"MiMo TTS returned no audio","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"open-sse/handlers/ttsProviders/xiaomi-mimo.js","lineNumber":59,"sourceCode":"      audio: {\n        format: \"wav\",\n        voice: voiceId || DEFAULT_VOICE,\n      },\n    }),\n  });\n\n  const rawText = await res.text();\n  let data = {};\n  if (rawText) {\n    try { data = JSON.parse(rawText); } catch { data = {}; }\n  }\n\n  if (!res.ok) {\n    throw new Error(data?.error?.message || rawText || `MiMo TTS error (${res.status})`);\n  }\n\n  const audio = data?.choices?.[0]?.message?.audio?.data;\n  if (!audio) throw new Error(data?.error?.message || \"MiMo TTS returned no audio\");\n\n  return {\n    base64: audio,\n    format: data?.choices?.[0]?.message?.audio?.format || \"wav\",\n  };\n}\n","sourceCodeStart":41,"sourceCodeEnd":66,"githubUrl":"https://github.com/decolua/9router/blob/90b52e06ffd666b7929554211474d01588f6b1f8/open-sse/handlers/ttsProviders/xiaomi-mimo.js#L41-L66","documentation":"Thrown when the MiMo upstream returns HTTP OK but the response JSON has no choices[0].message.audio.data — i.e., the API accepted the request but returned no audio payload. The handler prefers data.error.message if present to hint at the cause.","triggerScenarios":"MiMo returns 200 with an empty choices array, a text-only message, or an audio object missing data (e.g. content-filtered input, silent generation failure, or API response shape change).","commonSituations":"Input text blocked by content moderation, account without TTS entitlement returning an empty success, MiMo API version updating the audio field location, or extremely long input being truncated to no audio.","solutions":["Log the full response JSON to inspect choices and any embedded error message","Verify the account has MiMo TTS entitlement enabled","Shorten/sanitize input text to rule out moderation or length limits","Check for MiMo API version changes to the audio response shape","Retry once to rule out a transient upstream hiccup"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"if (typeof text !== \"string\" || text.length === 0 || text.length > MAX_MIMO_INPUT) throw new Error(\"MiMo TTS: invalid input text\");","typeGuard":"function mimoResponseHasAudio(d) {\n  const a = d?.choices?.[0]?.message?.audio;\n  return typeof a?.data === \"string\" && a.data.length > 0;\n}","tryCatchPattern":"try {\n  return await synthesizeMiMo(text, model, key, style, language);\n} catch (e) {\n  if (e.message === \"MiMo TTS returned no audio\") {\n    logger.warn(\"mimo tts: empty audio in 200 response\", { model });\n    return fallbackTts(text);\n  }\n  throw e;\n}","preventionTips":["Sanitize/shorten input text to avoid moderation and length rejections","Log the full 200-response body at debug level to catch shape changes","Verify TTS entitlement is active for the Xiaomi account","Fall back to a secondary TTS provider when audio is empty"],"tags":["tts","xiaomi","mimo","empty-response"],"backgroundTag":"empty-response-body","analyzedSha":"90b52e06ffd666b7929554211474d01588f6b1f8","analyzedAt":"2026-08-30T21:05:45.952Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}