{"record":{"id":"2cb5854e3a017f69","repo":"OpenBMB/VoxCPM","slug":"reference-wav-path-does-not-exist-reference-wav","errorCode":null,"errorMessage":"reference_wav_path does not exist: {reference_wav_path}","messagePattern":"reference_wav_path does not exist: (.+?)","errorType":"validation","errorClass":"FileNotFoundError","httpStatus":null,"severity":"error","filePath":"src/voxcpm/core.py","lineNumber":237,"sourceCode":"            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\n            actual_ref_path = reference_wav_path\n\n            if denoise and self.denoiser is not None:\n                if prompt_wav_path is not None:","sourceCodeStart":219,"sourceCodeEnd":255,"githubUrl":"https://github.com/OpenBMB/VoxCPM/blob/f5a1c6a6b901bc732e20f0d59a369f6829ad717a/src/voxcpm/core.py#L219-L255","documentation":"The VoxCPM2-only reference audio path is existence-checked in _generate; missing file raises FileNotFoundError.","triggerScenarios":"Calling generate with reference_wav_path pointing to a nonexistent file (only valid on VoxCPM2 models anyway).","commonSituations":"Same as prompt_wav_path: wrong CWD for relative paths, missing upload, or stale config referencing a deleted reference clip.","solutions":["Verify the reference wav path exists and is readable","Use absolute paths in configs","Re-download/regenerate the reference audio if produced upstream"],"exampleFix":"# before\nmodel.generate(text, reference_wav_path=\"/data/ref.wav\")\n# after\nimport os\nref = \"/data/ref.wav\"\nif not os.path.exists(ref):\n    raise FileNotFoundError(ref)\nmodel.generate(text, reference_wav_path=ref)","handlingStrategy":"validation","validationCode":"import os\nif reference_wav_path and not os.path.isfile(reference_wav_path):\n    raise FileNotFoundError(reference_wav_path)","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Store reference clips in a stable data dir and reference by absolute path"],"tags":["voice-cloning","file-not-found","reference-audio"],"backgroundTag":"file-not-found","analyzedSha":"f5a1c6a6b901bc732e20f0d59a369f6829ad717a","analyzedAt":"2026-08-27T05:54:30.617Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}