$ show jianchang512/stt
This repository is an offline speech-to-text application that uses the faster-whisper model to transcribe audio and video files into text, JSON, or SRT formats. It provides a web interface built with LayUI and a REST API (including an OpenAI-compatible endpoint) for easy integration. The application supports CPU and CUDA acceleration, caches loaded models for efficiency, and handles media conversion via FFmpeg. The architecture consists of a Flask web server served by gevent, with a background thread processing transcription tasks from a queue. Configuration is managed via an INI file, and utilities for FFmpeg execution, update checking, and browser launching are encapsulated in a helper module. The model caching mechanism avoids reloading large models for multiple requests, improving performance in a server setting.
The LLM identified 2 files worth highlighting for reuse:
Provides a robust wrapper for executing ffmpeg commands with timeout handling and error reporting, a function to check for software updates by comparing local and remote versions, and a utility to open the default web browser. These functions are largely independent and can be extracted for use in other projects requiring media processing or update checking.
Contains a function `parse_ini` that reads an INI file and returns a dictionary with automatic type conversion (values are converted to bool, int, list, or string as appropriate). This function is self-contained and can be used in any project needing to parse configuration files with type safety.