{"record":{"id":"5fa1955bd6b804b8","repo":"ScrapeGraphAI/Scrapegraph-ai","slug":"no-audio-generated-from-the-text","errorCode":null,"errorMessage":"No audio generated from the text.","messagePattern":"No audio generated from the text\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"scrapegraphai/graphs/speech_graph.py","lineNumber":120,"sourceCode":"            ],\n            entry_point=fetch_node,\n            graph_name=self.__class__.__name__,\n        )\n\n    def run(self) -> str:\n        \"\"\"\n        Executes the scraping process and returns the answer to the prompt.\n\n        Returns:\n            str: The answer to the prompt.\n        \"\"\"\n\n        inputs = {\"user_prompt\": self.prompt, self.input_key: self.source}\n        self.final_state, self.execution_info = self.graph.execute(inputs)\n\n        audio = self.final_state.get(\"audio\", None)\n        if not audio:\n            raise ValueError(\"No audio generated from the text.\")\n        save_audio_from_bytes(audio, self.config.get(\"output_path\", \"output.mp3\"))\n        logger.info(\"Audio saved to %s\", self.config.get(\"output_path\", \"output.mp3\"))\n\n        return self.final_state.get(\"answer\", \"No answer found.\")\n","sourceCodeStart":102,"sourceCodeEnd":125,"githubUrl":"https://github.com/ScrapeGraphAI/Scrapegraph-ai/blob/532dfffbf6ee823a6c9cf8cfedc24a93bf026780/scrapegraphai/graphs/speech_graph.py#L102-L125","documentation":"SpeechGraph.run executes the TTS pipeline and then checks final_state.get('audio'); if it is None or empty (falsy), it raises ValueError('No audio generated from the text.') before saving the mp3. This means the audio-producing node did not write bytes into state — typically an upstream failure or a provider returning empty output.","triggerScenarios":"The text-to-speech node failed silently, the state key 'audio' was overwritten by another node, the LLM/TTS provider returned empty content, or the answer node produced no text to synthesize.","commonSituations":"Invalid/expired TTS API key producing empty responses; the model outputting an empty answer for the given prompt; graph customization renaming or dropping the 'audio' state key; provider quota exhausted.","solutions":["Inspect self.final_state after catching the error to see which keys exist and whether 'answer' was produced.","Verify the TTS provider credentials and quota in config (headless / tts options).","If you customized nodes, ensure the final node stores bytes under state key 'audio'.","Simplify the prompt or check the transcript for empty content and retry."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    result = speech_graph.run()\nexcept ValueError as e:\n    if 'No audio generated' in str(e):\n        audio = speech_graph.final_state.get('audio')\n        answer = speech_graph.final_state.get('answer')\n        logger.error('TTS produced no audio; answer=%r', answer)\n        raise","preventionTips":["Inspect final_state keys after execution to confirm 'audio' and 'answer' are produced.","Verify TTS provider credentials and quota before running.","Check that the prompt yields non-empty text to synthesize."],"tags":["tts","empty-response","state","speech-graph"],"backgroundTag":"empty-provider-response","analyzedSha":"532dfffbf6ee823a6c9cf8cfedc24a93bf026780","analyzedAt":"2026-08-28T15:19:38.821Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}