{"record":{"id":"711fca64f981bc29","repo":"chenhg5/cc-connect","slug":"mimo-tts-empty-audio-data-in-response","errorCode":null,"errorMessage":"mimo tts: empty audio data in response","messagePattern":"mimo tts: empty audio data in response","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/tts.go","lineNumber":517,"sourceCode":"\t\t\t\tAudio struct {\n\t\t\t\t\tData string `json:\"data\"`\n\t\t\t\t} `json:\"audio\"`\n\t\t\t} `json:\"message\"`\n\t\t} `json:\"choices\"`\n\t\tError *struct {\n\t\t\tMessage string `json:\"message\"`\n\t\t\tType    string `json:\"type\"`\n\t\t\tCode    any    `json:\"code\"`\n\t\t} `json:\"error\"`\n\t}\n\tif err := json.Unmarshal(body, &result); err != nil {\n\t\treturn nil, \"\", fmt.Errorf(\"mimo tts: parse response: %w\", err)\n\t}\n\tif result.Error != nil && result.Error.Message != \"\" {\n\t\treturn nil, \"\", fmt.Errorf(\"mimo tts API error: %s\", result.Error.Message)\n\t}\n\tif len(result.Choices) == 0 || result.Choices[0].Message.Audio.Data == \"\" {\n\t\treturn nil, \"\", fmt.Errorf(\"mimo tts: empty audio data in response\")\n\t}\n\n\taudio, err := base64.StdEncoding.DecodeString(result.Choices[0].Message.Audio.Data)\n\tif err != nil {\n\t\treturn nil, \"\", fmt.Errorf(\"mimo tts: decode audio base64: %w\", err)\n\t}\n\treturn audio, \"wav\", nil\n}\n\n// ──────────────────────────────────────────────────────────────\n// EspeakTTS — Local eSpeak text-to-speech implementation\n// ──────────────────────────────────────────────────────────────\n\n// EspeakTTS implements TextToSpeech using the local espeak command.\ntype EspeakTTS struct {\n\tPath  string // path to espeak executable (empty = \"espeak\")\n\tVoice string // default voice (e.g. \"zh\", \"en\", \"zh+f3\")\n}","sourceCodeStart":499,"sourceCodeEnd":535,"githubUrl":"https://github.com/chenhg5/cc-connect/blob/4000b2338aa6e850c99df54f8b0ed6ed7460b401/core/tts.go#L499-L535","documentation":"MiMo TTS returned a 200 with parseable JSON but no audio: the choices array is empty or choices[0].message.audio.data is an empty string. Guard against synthesizing an empty/invalid voice message downstream.","triggerScenarios":"Thrown at core/tts.go:517 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry; shorten the input text","Verify the configured TTS model/voice is supported"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"4000b2338aa6e850c99df54f8b0ed6ed7460b401","analyzedAt":"2026-09-06T11:45:09.575Z","contentChangedAt":"2026-09-06T11:45:09.575Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}