babysor/MockingBird · error · ValueError
Input text is empty.
Error message
Input text is empty.
What it means
ValueError raised by main() when the effective input text is empty after reading from --text or --text-file and stripping whitespace. TTS synthesis requires non-empty text.
Source
Thrown at skills/speak/scripts/noiz_tts.py:162
parser.add_argument(
"--duration",
type=float,
default=None,
metavar="SEC",
help="Target audio duration in seconds (0, 36], optional",
)
parser.add_argument("--timeout-sec", type=int, default=120)
args = parser.parse_args()
args.api_key = normalize_api_key_base64(args.api_key)
try:
if args.text_file:
text = Path(args.text_file).read_text(encoding="utf-8").strip()
else:
text = args.text
if not text:
raise ValueError("Input text is empty.")
if len(text) > 5000:
print(
f"Warning: text is {len(text)} chars (max 5000). "
"Consider chunking for long texts.",
file=sys.stderr,
)
if args.auto_emotion:
text = call_emotion_enhance(
args.base_url, args.api_key, text, args.timeout_sec
)
ref = Path(args.reference_audio) if args.reference_audio else None
out_duration = synthesize(
base_url=args.base_url,
api_key=args.api_key,
text=text,View on GitHub (pinned to 28dc5e14f1)
Solutions
- Check the file/argument actually contains content before running
- Validate upstream producers that generate the text file
- Fail fast in shell: [ -s input.txt ] || exit 1
Example fix
# before
python noiz_tts.py --text-file empty.txt ...
# after
[ -s input.txt ] || { echo "input empty"; exit 1; }
python noiz_tts.py --text-file input.txt ... Defensive patterns
Strategy: validation
Validate before calling
text = (Path(args.text_file).read_text(encoding='utf-8') if args.text_file else args.text).strip()
if not text:
sys.exit('Input text is empty.') Try / catch
try:
main()
except ValueError as e:
sys.exit(str(e)) if 'empty' in str(e) else raise_ Prevention
- [ -s file.txt ] shell guards in pipelines
- Validate producer outputs before invoking TTS
- Strip and assert non-empty at ingest
When it happens
Trigger: Passing --text "" or whitespace-only string; passing --text-file pointing at an empty file or one containing only whitespace/newlines.
Common situations: Empty input file from a previous failed pipeline step, whitespace-only argument from unquoted shell expansion, or wrong file passed via --text-file.
Related errors
- duration must be in range (0, 36] seconds
- Either --voice-id or --reference-audio is required.
- Cue {cue.index}: either voice_id or reference_audio required
- /emotion-enhance failed: status={resp.status_code}, body={re
- /emotion-enhance returned no data: {resp.text}
AI-assisted analysis of babysor/MockingBird@28dc5e14f1 (2026-08-27).
Data as JSON: /api/errors/6150cc95f7c0731e.
Report an issue: GitHub.