babysor/MockingBird · error · FileNotFoundError
Reference audio not found: {reference_audio}
Error message
Reference audio not found: {reference_audio} What it means
FileNotFoundError raised by synthesize() when reference_audio is provided as a Path but does not exist on disk. Voice cloning via reference audio requires a readable file that is uploaded as multipart form data.
Source
Thrown at skills/speak/scripts/noiz_tts.py:93
"speed": str(speed),
}
if voice_id:
data["voice_id"] = voice_id
if emo:
data["emo"] = emo
if target_lang:
data["target_lang"] = target_lang
if similarity_enh:
data["similarity_enh"] = "true"
if save_voice:
data["save_voice"] = "true"
if duration is not None:
data["duration"] = str(duration)
files = None
if reference_audio:
if not reference_audio.exists():
raise FileNotFoundError(f"Reference audio not found: {reference_audio}")
files = {
"file": (
reference_audio.name,
reference_audio.open("rb"),
"application/octet-stream",
)
}
elif not voice_id:
raise ValueError("Either --voice-id or --reference-audio is required.")
try:
resp = requests.post(
url,
headers={"Authorization": api_key},
data=data,
files=files,
timeout=timeout,
)View on GitHub (pinned to 28dc5e14f1)
Solutions
- Check the path exists and is absolute before calling synthesize
- Verify spelling and CWD; use Path(__file__).resolve().parent anchors for bundled samples
- Re-download or regenerate the missing reference file
- Ensure the process has read permission on the file
Example fix
# before
ref = Path("voice.wav")
synthesize(..., reference_audio=ref)
# after
ref = Path("voice.wav").resolve()
if not ref.is_file():
sys.exit(f"reference audio missing: {ref}")
synthesize(..., reference_audio=ref) Defensive patterns
Strategy: validation
Validate before calling
from pathlib import Path
ref = Path(args.reference_audio).resolve()
assert ref.is_file(), f'missing reference audio: {ref}' Try / catch
try:
synthesize(..., reference_audio=ref)
except FileNotFoundError:
sys.exit(f'reference audio missing: {ref}') Prevention
- Resolve reference paths to absolute before use
- Existence-check uploads before any network call
- Keep voice samples in a stable, committed directory
When it happens
Trigger: Passing --reference-audio /path/to/voice.wav where the file was deleted, is on a different machine, or the path is misspelled; also relative paths resolved from the wrong CWD.
Common situations: Hardcoded sample paths, running the script from a different working directory, or referencing files in a temp dir already cleaned up.
Understand the failure class
Background: "File not found" and ENOENT errors: why libraries can't find a file that should exist — this error's family across 50 libraries.
Related errors
- reference_audio not found: {ref}
- Model folder {SYN_MODELS_DIRT} doesn't exist. 请将模型文件位置移动到上述位
- Model folder {ENC_MODELS_DIRT} doesn't exist.
- Model folder {VOC_MODELS_DIRT} doesn't exist.
- Model folder {EXT_MODELS_DIRT} doesn't exist.
AI-assisted analysis of babysor/MockingBird@28dc5e14f1 (2026-08-27).
Data as JSON: /api/errors/f3990cb816cace21.
Report an issue: GitHub.