Skip to content

Conversation

@manikyarathore
Copy link

Users could specify incorrect file formats for input/output paths without receiving validation errors. For example, using --output-path /tmp/artbox/speech.md (text format) instead of speech.mp3 (audio format) for text to speech conversion would complete without error, causing downstream operations to fail.

Solution
= Implemented file format validation for Artbox CLI operations:

New Files:
= validators.py - Validator module with validate_io_paths() function

Changes:
= Validates input/output file extensions based on operation type:
text-to-speech (tts): requires audio output (.mp3, .wav, .ogg, .flac, .m4a, .aac)
speech-to-text (stt): requires audio input and text output (.txt, .md, .srt, .vtt, .json)
Infers operation type from file extensions if not explicitly provided
Raises clear, user-friendly error messages with supported format lists
Exits with code 2 on validation failure
Modified Files:

Benefits

Catches format errors early, saving user time
Clear error messages guide users to correct formats
Prevents cascading failures in multi-step operations
Works with both explicit and inferred operation types

@xmnlab
Copy link
Member

xmnlab commented Nov 12, 2025

Hi @manikyarathore ! if you want to open an gh issue or raise a PR for artbox, this is its repo: https://github.com/osl-incubator/artbox

@xmnlab xmnlab closed this Nov 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants