{"record":{"id":"e8cb476984f9bfb9","repo":"OpenBMB/VoxCPM","slug":"prompt-wav-path-does-not-exist-prompt-wav-path","errorCode":null,"errorMessage":"prompt_wav_path does not exist: {prompt_wav_path}","messagePattern":"prompt_wav_path does not exist: (.+?)","errorType":"validation","errorClass":"FileNotFoundError","httpStatus":null,"severity":"error","filePath":"src/voxcpm/core.py","lineNumber":233,"sourceCode":"            normalize: Whether to run text normalization before generation.\n            denoise: Whether to denoise the prompt/reference audio if a\n                denoiser is available.\n            retry_badcase: Whether to retry badcase.\n            retry_badcase_max_times: Maximum number of times to retry badcase.\n            retry_badcase_ratio_threshold: Threshold for audio-to-text ratio.\n            streaming: Whether to return a generator of audio chunks.\n            seed: Optional random seed for reproducibility.\n        Returns:\n            Generator of numpy.ndarray: 1D waveform array (float32) on CPU.\n            Yields audio chunks for each generation step if ``streaming=True``,\n            otherwise yields a single array containing the final audio.\n        \"\"\"\n        if not isinstance(text, str) or not text.strip():\n            raise ValueError(\"target text must be a non-empty string\")\n\n        if prompt_wav_path is not None:\n            if not os.path.exists(prompt_wav_path):\n                raise FileNotFoundError(f\"prompt_wav_path does not exist: {prompt_wav_path}\")\n\n        if reference_wav_path is not None:\n            if not os.path.exists(reference_wav_path):\n                raise FileNotFoundError(f\"reference_wav_path does not exist: {reference_wav_path}\")\n\n        if (prompt_wav_path is None) != (prompt_text is None):\n            raise ValueError(\"prompt_wav_path and prompt_text must both be provided or both be None\")\n\n        is_v2 = isinstance(self.tts_model, VoxCPM2Model)\n        if reference_wav_path is not None and not is_v2:\n            raise ValueError(\"reference_wav_path is only supported with VoxCPM2 models\")\n\n        text = text.replace(\"\\n\", \" \")\n        text = re.sub(r\"\\s+\", \" \", text)\n        temp_files = []\n\n        try:\n            actual_prompt_path = prompt_wav_path","sourceCodeStart":215,"sourceCodeEnd":251,"githubUrl":"https://github.com/OpenBMB/VoxCPM/blob/f5a1c6a6b901bc732e20f0d59a369f6829ad717a/src/voxcpm/core.py#L215-L251","documentation":"Voice-cloning prompt audio path is checked with os.path.exists before inference; a missing file raises FileNotFoundError.","triggerScenarios":"Calling generate(..., prompt_wav_path=...) where the wav file does not exist at that path at call time.","commonSituations":"Relative path resolved from a different CWD, uploaded file not yet written to disk, or prompt file deleted between runs.","solutions":["Verify/correct the path (use absolute paths)","Ensure any uploaded/generated prompt wav is fully written before generate()","Confirm the file extension/case matches on case-sensitive filesystems"],"exampleFix":"# before\nmodel.generate(text, prompt_wav_path=\"ref/voice.WAV\")\n# after\nfrom pathlib import Path\np = Path(\"ref/voice.wav\").resolve()\nassert p.exists(), p\nmodel.generate(text, prompt_wav_path=str(p))","handlingStrategy":"validation","validationCode":"from pathlib import Path\np = Path(prompt_wav_path).resolve()\nif not p.is_file():\n    raise FileNotFoundError(p)\nprompt_wav_path = str(p)","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Resolve prompt paths to absolute before calling generate","Verify uploads are flushed to disk before synthesis"],"tags":["voice-cloning","file-not-found","prompt-audio"],"backgroundTag":"file-not-found","analyzedSha":"f5a1c6a6b901bc732e20f0d59a369f6829ad717a","analyzedAt":"2026-08-27T05:54:30.617Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}