This repository contains my submission for the AI Engineer technical assessment at AutoScript. It is a pipeline that analyzes audio deposition files, extracts technical metadata, and generates structured insights using LLM.
The system is designed in a modular way using Python and executes in the following steps:
- Metadata Extraction: Uses
ffprobeto extract duration, bitrate, sample rate, and channels. - Quality Analysis: Uses
ffmpeg(specificallysilencedetectandvolumedetectfilters) to find silence segments and potential clipping issues. - Structured Output: Uses
pydanticto ensure the final output strictly follows the required JSON schema. - LLM Insights: Feeds the metadata and quality metrics into a Gemini LLM to generate a concise summary and technical recommendations.
- Automated Retry Mechanism: To handle real-world API rate limits and high server demands (like
503 Unavailableerrors), I implemented an automatic retry block with a cooldown timer. This ensures the pipeline doesn't crash during batch processing. - Format Agnostic: Relies on system-level
ffmpegbinaries, allowing it to seamlessly process.wav,.mp3, or.flacfiles without code changes.
Since this was developed in Google Colab, the easiest way to test the pipeline is by running the .ipynb notebook.
- Open the
.ipynbfile in Google Colab. - Add your Gemini API Key in the Colab Secrets tab named
GEMINI_API_KEY. - Upload an audio file to the
/sample_audiofolder. - Run all cells sequentially.