### Clone Repository and Run Setup Script Source: https://github.com/ombharatiya/transcript-ai/blob/main/README.md Clone the TranscriptAI repository and navigate to the CLI directory. Execute the setup script to automatically install Python dependencies, set up a virtual environment, and install FFmpeg. ```bash git clone https://github.com/ombharatiya/transcript-ai.git cd transcript-ai/cli python setup.py ``` -------------------------------- ### CLI Installation and Setup Source: https://github.com/ombharatiya/transcript-ai/blob/main/web/src/docs.html Clone the repository and run the setup script for the CLI tool. Activate the virtual environment before running transcription commands. ```bash git clone https://github.com/ombharatiya/transcript-ai.git cd transcript-ai/cli python setup.py source venv/bin/activate python src/audio_transcriber.py input/audio.mp3 ``` -------------------------------- ### Manual CLI Setup Alternative Source: https://context7.com/ombharatiya/transcript-ai/llms.txt Manually set up the virtual environment, install Python dependencies, and install FFmpeg if the automated script is not used. ```bash # Manual setup alternative python3 -m venv venv source venv/bin/activate # Windows: venv\Scripts\activate pip install -r requirements.txt brew install ffmpeg # macOS; see README for Linux/Windows ``` -------------------------------- ### FFmpeg Installation for CLI Source: https://github.com/ombharatiya/transcript-ai/blob/main/README.md Instructions for installing FFmpeg, a dependency for audio processing. Use the provided setup script or manual installation methods for macOS, Ubuntu/Debian, or Windows. ```bash # Install ffmpeg using the setup script: python setup.py # Or install manually: # macOS brew install ffmpeg # Ubuntu/Debian sudo apt install ffmpeg # Windows: Download from https://ffmpeg.org/download.html ``` -------------------------------- ### Manual CLI Setup - Install FFmpeg Source: https://github.com/ombharatiya/transcript-ai/blob/main/README.md Instructions for installing FFmpeg on macOS, Ubuntu/Debian, and Windows. FFmpeg is required for audio processing. ```bash # macOS brew install ffmpeg ``` ```bash # Ubuntu/Debian sudo apt update && sudo apt install ffmpeg ``` ```bash # Windows # Download from https://ffmpeg.org/download.html and add to PATH ``` -------------------------------- ### CLI Manual Installation Source: https://github.com/ombharatiya/transcript-ai/blob/main/web/src/docs.html Manually set up the Python virtual environment and install dependencies for the CLI tool if the automatic setup is not used. ```bash python3 -m venv venv source venv/bin/activate pip install -r requirements.txt ``` -------------------------------- ### Quick Start: Set Up and Transcribe Audio Source: https://github.com/ombharatiya/transcript-ai/blob/main/cli/README.md Navigate to the CLI directory, set up the environment, activate the virtual environment, and then transcribe an audio file. ```bash # Navigate to CLI directory cd cli # Set up environment python setup.py # Activate environment source venv/bin/activate # Transcribe audio python src/audio_transcriber.py input/audio.mp3 ``` -------------------------------- ### Clone and Run Automated Setup Script Source: https://context7.com/ombharatiya/transcript-ai/llms.txt Use this command to clone the repository and run the automated setup script, which installs dependencies and FFmpeg. ```bash # Clone and run one-command setup git clone https://github.com/ombharatiya/transcript-ai.git cd transcript-ai/cli python setup.py # Expected output: # 🎵 Audio Transcription Tool Setup # ======================================== # ✓ Python 3.11.x detected # Creating virtual environment... # ✓ Virtual environment created # ✓ Python dependencies installed # ✓ ffmpeg installed via Homebrew # ======================================== # 🎉 Setup complete! # 1. Activate environment: source venv/bin/activate # 2. Test installation: python src/audio_transcriber.py --help # 3. Transcribe audio: python src/audio_transcriber.py your_audio.mp3 ``` -------------------------------- ### Manual CLI Setup - Install Dependencies Source: https://github.com/ombharatiya/transcript-ai/blob/main/README.md Install the required Python dependencies for the CLI tool using pip after activating the virtual environment. ```bash pip install -r requirements.txt ``` -------------------------------- ### Install and Use TranscriptAI CLI Source: https://github.com/ombharatiya/transcript-ai/blob/main/docs/index.html Instructions for installing the TranscriptAI CLI tool and performing basic audio transcription. ```bash # Install TranscriptAI CLI git clone https://github.com/ombharatiya/transcript-ai cd transcript-ai/cli python setup.py ``` ```bash # Transcribe audio python src/audio_transcriber.py input/audio.mp3 ``` -------------------------------- ### Logging Configuration and Examples Source: https://context7.com/ombharatiya/transcript-ai/llms.txt CLI logging details, including file location, example log entries, and programmatic access to logger settings. ```python # Log file location # cli/logs/transcription_20240810.log # Example log entries: # 2024-08-10 14:30:01,234 - INFO - Loading Whisper model (medium)... # 2024-08-10 14:30:08,891 - INFO - Model loaded successfully # 2024-08-10 14:30:08,892 - INFO - Transcribing: meeting.wav (12.4 MB) # 2024-08-10 14:31:03,445 - INFO - Text transcription saved to: outputs/meeting_transcription.txt # 2024-08-10 14:31:03,512 - INFO - Detailed results saved to: outputs/meeting_detailed.json # 2024-08-10 14:31:03,513 - INFO - Batch transcription completed # Programmatic log access import logging logging.getLogger("audio_transcriber").setLevel(logging.DEBUG) ``` -------------------------------- ### Install and Use TranscriptAI CLI Source: https://github.com/ombharatiya/transcript-ai/blob/main/web/src/index.html Instructions for installing the TranscriptAI CLI tool and performing basic audio transcription and batch processing. ```bash git clone https://github.com/ombharatiya/transcript-ai cd transcript-ai/cli python setup.py ``` ```bash python src/audio_transcriber.py input/audio.mp3 ``` ```bash python src/audio_transcriber.py input/*.wav --batch ``` ```bash python src/audio_transcriber.py audio.mp3 \ --model large \ --language en \ --task translate ``` -------------------------------- ### Manual CLI Setup - Virtual Environment Source: https://github.com/ombharatiya/transcript-ai/blob/main/README.md Manually create and activate a Python virtual environment for the CLI tool. This is an alternative to the automatic setup script. ```bash python3 -m venv venv source venv/bin/activate ``` ```bash venv\Scripts\activate ``` -------------------------------- ### Web Interface - OpenAI API Call (Raw Fetch) Source: https://context7.com/ombharatiya/transcript-ai/llms.txt Example of making a direct POST request to the OpenAI audio transcriptions endpoint using the Fetch API. ```APIDOC ## Web Interface — OpenAI API Call (Raw `fetch`) ### Description Demonstrates how to directly call the OpenAI transcriptions endpoint from the browser using `fetch` and `FormData`. ### Method `POST` ### Endpoint `https://api.openai.com/v1/audio/transcriptions` ### Request Body (FormData) - **file** (File) - Required - The audio file to transcribe. - **model** (string) - Required - Set to `whisper-1`. - **language** (string) - Optional - ISO 639-1 code for the audio language. - **response_format** (string) - Optional - Set to `verbose_json` for detailed output. ### Request Example ```javascript const formData = new FormData(); formData.append('file', audioFileObject); formData.append('model', 'whisper-1'); formData.append('language', 'en'); formData.append('response_format', 'verbose_json'); const response = await fetch('https://api.openai.com/v1/audio/transcriptions', { method: 'POST', headers: { 'Authorization': `Bearer sk-...your-key...` }, body: formData }); if (!response.ok) { // Handle errors: 401 (Invalid API key), 429 (Rate limit), 413 (File too large) } const data = await response.json(); ``` ### Response Example (Success) ```json { "text": "Full transcription text", "language": "en", "duration": 222.4, "segments": [ { "id": 0, "start": 0.0, "end": 4.2, "text": " Hello everyone." }, ... ] } ``` ``` -------------------------------- ### Transcribe Audio with Smaller Model Source: https://github.com/ombharatiya/transcript-ai/blob/main/README.md Use the 'small' model for faster audio processing. Ensure Python 3.8+ is installed. ```bash python src/audio_transcriber.py file.mp3 --model small ``` -------------------------------- ### Create Feature Branch for Web Enhancement Source: https://github.com/ombharatiya/transcript-ai/blob/main/web/README.md Example Git command to create a new branch for developing a web interface feature. Followed by making changes and submitting a pull request. ```bash git checkout -b feature/web-enhancement ``` -------------------------------- ### Current CLI Project Structure Source: https://github.com/ombharatiya/transcript-ai/blob/main/PROJECT_STRUCTURE.md This is the existing directory structure focused on a Python CLI tool. It includes source code, sample input/output, configuration, temporary files, logs, dependencies, and setup scripts. ```tree transcript-ai/ ├── src/ # CLI source code ├── input/ # Sample audio files ├── outputs/ # Sample transcriptions ├── config/ # Configuration files ├── temp/ # User temporary files ├── logs/ # Application logs ├── requirements.txt # Python dependencies ├── setup.py # CLI setup script └── README.md # Main documentation ``` -------------------------------- ### Example JSON Output Structure Source: https://github.com/ombharatiya/transcript-ai/blob/main/README.md This is an example of the detailed JSON output format, which includes the transcription text, segment information, word-level timestamps, and metadata. ```json { "text": "Your transcribed text here...", "segments": [ { "id": 0, "seek": 0, "start": 0.0, "end": 5.0, "text": " Your transcribed text here...", "tokens": [50364, 2396, ...], "temperature": 0.0, "avg_logprob": -0.5, "compression_ratio": 1.2, "no_speech_prob": 0.1 } ], "language": "en", "metadata": { "file_info": { "filename": "audio.mp3", "size_mb": 5.2, "format": ".mp3", "supported": true }, "model_used": "base", "transcription_time": "0:00:30.123456", "timestamp": "2024-01-01T12:00:00.000000" } } ``` -------------------------------- ### Get Audio File Metadata Source: https://context7.com/ombharatiya/transcript-ai/llms.txt Retrieves metadata for an audio file, including filename, size, and format, without loading the transcription model. Checks if the format is supported. ```python transcriber = AudioTranscriber() info = transcriber.get_audio_info("input/sample_meeting.wav") print(info) # { # 'filename': 'sample_meeting.wav', # 'size_mb': 12.4, # 'format': '.wav', # 'supported': True # } info_bad = transcriber.get_audio_info("input/recording.xyz") print(info_bad) # { # 'filename': 'recording.xyz', # 'size_mb': 3.1, # 'format': '.xyz', # 'supported': False # } ``` -------------------------------- ### Set Up Web Development Server Source: https://github.com/ombharatiya/transcript-ai/blob/main/web/src/docs.html Steps to set up and run the web development server locally. ```bash # Set up web development cd transcript-ai/web npm install # if using build tools python -m http.server 8000 # serve locally ``` -------------------------------- ### Clone Repository and Set Up CLI Source: https://github.com/ombharatiya/transcript-ai/blob/main/web/src/docs.html Instructions for forking the TranscriptAI repository and setting up the CLI for development. ```bash # Fork the repository git clone https://github.com/yourusername/transcript-ai.git # Set up CLI development cd transcript-ai/cli python setup.py ``` -------------------------------- ### Display Help and Advanced Options Source: https://github.com/ombharatiya/transcript-ai/blob/main/cli/README.md Access comprehensive documentation and available options by running the script with the --help flag. ```bash python src/audio_transcriber.py --help ``` -------------------------------- ### Manual Web Interface Deployment Source: https://github.com/ombharatiya/transcript-ai/blob/main/web/README.md Commands for manually building and deploying the web interface. This involves copying source files to the 'docs/' directory, committing, and pushing. ```bash cd web cp -r src/* ../docs/ git add ../docs/ git commit -m "Update web interface" git push origin main ``` -------------------------------- ### Manual Deployment of TranscriptAI Source: https://github.com/ombharatiya/transcript-ai/blob/main/DEPLOYMENT_GUIDE.md Execute these commands to manually build and deploy the web application if automated deployment fails. Ensure you are in the correct directory before running. ```bash # If automated deployment fails, you can deploy manually cd web npm run build npm run deploy git add ../docs/ git commit -m "Manual deployment update" git push origin main ``` -------------------------------- ### Serve Web Application Locally with http-server Source: https://github.com/ombharatiya/transcript-ai/blob/main/web/README.md Alternative command to serve the web application locally using the 'http-server' Node.js package. Ensure you are in the 'web' directory. ```bash npx http-server src/ ``` -------------------------------- ### Batch Process Audio Files with TranscriptAI CLI Source: https://github.com/ombharatiya/transcript-ai/blob/main/docs/index.html Demonstrates how to use the TranscriptAI CLI for batch processing multiple audio files. ```bash # Batch processing python src/audio_transcriber.py input/*.wav --batch ``` -------------------------------- ### Advanced TranscriptAI CLI Options Source: https://github.com/ombharatiya/transcript-ai/blob/main/docs/index.html Shows how to use advanced options with the TranscriptAI CLI, such as specifying the model, language, and task. ```bash # Advanced options python src/audio_transcriber.py audio.mp3 \ --model large \ --language en \ --task translate ``` -------------------------------- ### Serve Web Application Locally with Python Source: https://github.com/ombharatiya/transcript-ai/blob/main/web/README.md Command to serve the web application locally using Python's built-in HTTP server. Ensure you are in the 'web' directory. ```bash python -m http.server 8000 ``` -------------------------------- ### Initialize AudioTranscriber with Default Settings Source: https://context7.com/ombharatiya/transcript-ai/llms.txt Initializes the AudioTranscriber class using default settings for model size ('base') and output directory ('./outputs/'). ```python from src.audio_transcriber import AudioTranscriber # Default: 'base' model, output to ./outputs/ transcriber = AudioTranscriber() ``` -------------------------------- ### Check Supported File Formats Source: https://github.com/ombharatiya/transcript-ai/blob/main/README.md Verify supported audio file formats using the --info flag. For unsupported formats, FFmpeg can be used for conversion. ```bash python src/audio_transcriber.py input/file.xyz --info ``` ```bash ffmpeg -i input/file.xyz -c:a aac input/output.aac ``` -------------------------------- ### File Information CLI Source: https://github.com/ombharatiya/transcript-ai/blob/main/README.md Use this command to retrieve details about an audio file before transcription. ```bash # Check audio file details python src/audio_transcriber.py input/audio.mp3 --info ``` -------------------------------- ### Basic CLI Transcription Source: https://github.com/ombharatiya/transcript-ai/blob/main/README.md Use this command to transcribe a single audio file. Ensure you are in the CLI directory and have activated your virtual environment. ```bash # Navigate to CLI directory and activate environment cd transcript-ai/cli source venv/bin/activate # On Windows: venv\Scripts\activate # Transcribe a single file python src/audio_transcriber.py input/audio.mp3 # Use a different model python src/audio_transcriber.py input/audio.wav --model large # Specify language python src/audio_transcriber.py input/audio.aac --language en ``` -------------------------------- ### AudioTranscriber Initialization Source: https://context7.com/ombharatiya/transcript-ai/llms.txt Initializes the Whisper model wrapper, creates the output directory, configures log files, and auto-detects FFmpeg. Supports specifying model size and output directory. ```APIDOC ## AudioTranscriber Initialization `AudioTranscriber(model_size, output_dir)` initializes the Whisper model wrapper, creates the output directory, configures daily rotating log files, and auto-detects a local or system FFmpeg binary. ```python from src.audio_transcriber import AudioTranscriber # Default: 'base' model, output to ./outputs/ transcriber = AudioTranscriber() # High-accuracy setup with custom output directory transcriber = AudioTranscriber(model_size="large-v3", output_dir="/data/transcripts") # Available model sizes (speed ↔ accuracy trade-off): # tiny (39MB) | base (74MB) | small (244MB) | medium (769MB) # large (1.5GB) | large-v2 (1.5GB) | large-v3 (1.5GB) ``` ``` -------------------------------- ### Clone TranscriptAI Repository Source: https://github.com/ombharatiya/transcript-ai/blob/main/web/README.md Command to clone the TranscriptAI repository from GitHub. This is the first step for local development. ```bash git clone https://github.com/ombharatiya/transcript-ai.git cd transcript-ai/web ``` -------------------------------- ### CLI for Meeting Transcription Source: https://github.com/ombharatiya/transcript-ai/blob/main/shared/examples/USE_CASES.md Use the command-line interface to transcribe meeting audio files. Specify the model for desired accuracy and speed. ```bash python src/audio_transcriber.py meetings/weekly-standup.mp3 --model medium ``` -------------------------------- ### Default Configuration JSON Source: https://context7.com/ombharatiya/transcript-ai/llms.txt The default configuration file for the CLI, specifying model, language, output, and batch settings. ```json { "model_settings": { "default_model": "base", "available_models": ["tiny", "base", "small", "medium", "large", "large-v2", "large-v3"], "default_language": null, "default_task": "transcribe", "default_temperature": 0.0 }, "output_settings": { "output_directory": "outputs", "save_json_details": true, "log_directory": "logs", "timestamp_filenames": false }, "supported_formats": [".aac", ".flac", ".mp3", ".mp4", ".m4a", ".ogg", ".wav", ".webm"], "batch_settings": { "max_concurrent": 1, "continue_on_error": true } } ``` -------------------------------- ### GitHub Actions Workflow for Web Deployment Source: https://github.com/ombharatiya/transcript-ai/blob/main/web/README.md Configuration snippet for a GitHub Actions workflow that automates the deployment of the web interface to GitHub Pages. It copies source files to the 'docs/' directory for serving. ```yaml # .github/workflows/deploy-web.yml - Web source files are copied from web/src/ to docs/ - GitHub Pages serves from docs/ directory - Live at: https://ombharatiya.github.io/transcript-ai ``` -------------------------------- ### Initialize AudioTranscriber with Custom Settings Source: https://context7.com/ombharatiya/transcript-ai/llms.txt Initializes the AudioTranscriber class with a specified model size ('large-v3') and a custom output directory for transcripts. ```python # High-accuracy setup with custom output directory transcriber = AudioTranscriber(model_size="large-v3", output_dir="/data/transcripts") ``` -------------------------------- ### CLI - Command Reference Source: https://context7.com/ombharatiya/transcript-ai/llms.txt Provides command-line interface instructions for using the Transcript AI tool, covering single file transcription, batch processing, translation, and file information retrieval. ```APIDOC ## CLI — Command Reference The `main()` function in `audio_transcriber.py` exposes all `AudioTranscriber` capabilities as command-line flags. ### Usage 1. **Activate virtual environment:** ```bash source venv/bin/activate ``` 2. **Single File Transcription:** ```bash python src/audio_transcriber.py ``` *Example:* `python src/audio_transcriber.py input/audio.mp3` 3. **Single File with Options:** ```bash python src/audio_transcriber.py --model --language --output-dir ``` *Example:* `python src/audio_transcriber.py input/audio.wav --model large-v3 --language en --output-dir /data/results` 4. **Translation:** ```bash python src/audio_transcriber.py --task translate --language --temperature ``` *Example:* `python src/audio_transcriber.py input/french_lecture.mp3 --task translate --language fr --temperature 0.2` 5. **Batch Mode Transcription:** ```bash python src/audio_transcriber.py --batch --model ``` *Example:* `python src/audio_transcriber.py input/*.mp3 --batch --model medium` 6. **Batch Mode with Multiple Explicit Files:** ```bash python src/audio_transcriber.py ... --model --output-dir ``` *Example:* `python src/audio_transcriber.py file1.wav file2.mp3 file3.m4a --model small --output-dir outputs/project` 7. **File Information (No Transcription):** ```bash python src/audio_transcriber.py --info ``` *Example:* `python src/audio_transcriber.py input/audio.mp3 --info` *Output Example:* `AUDIO FILE INFORMATION` ``` -------------------------------- ### Podcast Show Notes Generation Source: https://github.com/ombharatiya/transcript-ai/blob/main/shared/examples/USE_CASES.md Generate show notes for a series of podcast episodes using batch processing. Specify an output directory for the generated files. ```bash python src/audio_transcriber.py podcasts/season1/*.mp3 --batch --model large --output-dir show-notes/ ``` -------------------------------- ### Batch Processing with CLI Source: https://github.com/ombharatiya/transcript-ai/blob/main/README.md Process multiple audio files efficiently using batch mode. You can specify file patterns or list individual files, and customize model and language settings. ```bash # Process multiple files python src/audio_transcriber.py input/*.mp3 --batch # Process specific files python src/audio_transcriber.py input/file1.wav input/file2.aac input/file3.mp3 # Batch with custom settings python src/audio_transcriber.py input/*.wav --batch --model medium --language es ``` -------------------------------- ### Run CLI for File Information Only Source: https://github.com/ombharatiya/transcript-ai/blob/main/web/src/docs.html Obtain file information without performing transcription using the --info flag. ```python python src/audio_transcriber.py audio.mp3 --info ``` -------------------------------- ### GitHub Actions CI/CD Workflows Source: https://github.com/ombharatiya/transcript-ai/blob/main/PROJECT_STRUCTURE.md This section outlines the CI/CD workflows for the monorepo. It includes configurations for testing the Python CLI, building the web interface, and deploying to GitHub Pages. ```yaml # CI for Python CLI # Build web interface # Deploy to GitHub Pages ``` -------------------------------- ### Run Audio Transcription via CLI Source: https://context7.com/ombharatiya/transcript-ai/llms.txt Execute audio transcription using the command-line interface. Specify input files and options like model, language, and output format. ```bash python src/audio_transcriber.py input/audio.mp3 --no-json ``` ```bash python src/audio_transcriber.py --help ``` -------------------------------- ### Run CLI and Adjust Temperature Source: https://github.com/ombharatiya/transcript-ai/blob/main/web/src/docs.html Control the randomness of the transcription output by adjusting the temperature parameter. ```python python src/audio_transcriber.py audio.mp3 --temperature 0.2 ``` -------------------------------- ### Transcription with Different Model Sizes Source: https://github.com/ombharatiya/transcript-ai/blob/main/cli/README.md Specify the desired AI model size (e.g., 'large') to balance speed and accuracy for transcription. ```bash # Different model sizes python src/audio_transcriber.py input/audio.wav --model large ``` -------------------------------- ### CLI for Audio Transcription Source: https://context7.com/ombharatiya/transcript-ai/llms.txt The command-line interface allows transcription of single files, translation, batch processing, and retrieving file information without transcription. Use flags like `--model`, `--language`, `--task`, `--batch`, and `--info` to control behavior. ```bash # Activate virtualenv first source venv/bin/activate # --- Single file --- python src/audio_transcriber.py input/audio.mp3 # With model and language python src/audio_transcriber.py input/audio.wav \ --model large-v3 \ --language en \ --output-dir /data/results # --- Translation --- python src/audio_transcriber.py input/french_lecture.mp3 \ --task translate \ --language fr \ --temperature 0.2 # --- Batch mode --- python src/audio_transcriber.py input/*.mp3 --batch --model medium # Multiple explicit files python src/audio_transcriber.py file1.wav file2.mp3 file3.m4a \ --model small \ --output-dir outputs/project # --- File info (no transcription) --- python src/audio_transcriber.py input/audio.mp3 --info # ============================================================ # AUDIO FILE INFORMATION ``` -------------------------------- ### Run CLI with Custom Output Directory Source: https://github.com/ombharatiya/transcript-ai/blob/main/web/src/docs.html Specify a custom directory for output files when using the CLI tool. ```python python src/audio_transcriber.py audio.mp3 --output-dir results/ ``` -------------------------------- ### Real-time Transcription for Accessibility Source: https://github.com/ombharatiya/transcript-ai/blob/main/shared/examples/USE_CASES.md Transcribe live audio streams for accessibility purposes. The 'auto' language detection is useful for unknown audio sources. ```bash python src/audio_transcriber.py live-meeting.wav --model base --language auto ``` -------------------------------- ### CLI Usage Source: https://context7.com/ombharatiya/transcript-ai/llms.txt Command-line interface for audio transcription. Supports various models, languages, and output options. ```APIDOC ## CLI Usage ### Description Command-line interface for audio transcription. Supports various models, languages, and output options. ### Usage ```bash python src/audio_transcriber.py input/audio.mp3 --no-json ``` ### Options Reference #### Positional Arguments - **files** (string) - One or more audio files #### Optional Arguments - **--model** (string) - Specifies the transcription model. Options: tiny, base, small, medium, large, large-v2, large-v3. Default: base. - **--language** (string) - ISO 639-1 code for the audio language (e.g., en, es, fr). Default: auto-detect. - **--task** (string) - Task to perform: transcribe or translate. Default: transcribe. - **--temperature** (float) - Controls randomness. Range: 0.0 (deterministic) to 1.0 (creative). Default: 0.0. - **--output-dir** (string) - Directory to save output files. Default: outputs. - **--no-json** (boolean) - Omit detailed JSON output. - **--batch** (boolean) - Enable explicit batch mode. - **--info** (boolean) - Print file metadata and skip transcription. ``` -------------------------------- ### Basic Transcription: Single Audio File Source: https://github.com/ombharatiya/transcript-ai/blob/main/cli/README.md Use this command to transcribe a single audio file. Ensure the input file path is correct. ```bash # Single file transcription python src/audio_transcriber.py input/meeting.wav ``` -------------------------------- ### CLI Basic Usage Source: https://github.com/ombharatiya/transcript-ai/blob/main/web/src/docs.html Execute transcriptions using the CLI tool for single files or batch processing. Options are available to specify models, languages, and tasks like translation. ```bash python src/audio_transcriber.py input/audio.mp3 ``` ```bash python src/audio_transcriber.py input/*.wav --batch ``` ```bash python src/audio_transcriber.py audio.mp3 --model large ``` ```bash python src/audio_transcriber.py audio.mp3 --language en ``` ```bash python src/audio_transcriber.py foreign.mp3 --task translate ``` -------------------------------- ### Batch Lecture Transcription Source: https://github.com/ombharatiya/transcript-ai/blob/main/shared/examples/USE_CASES.md Process an entire semester's worth of lecture recordings in batch mode. Larger models provide higher accuracy. ```bash python src/audio_transcriber.py lectures/*.mp3 --batch --model large ``` -------------------------------- ### Transcribe Multiple Audio Files in Batch Source: https://github.com/ombharatiya/transcript-ai/blob/main/cli/input/README.md This command transcribes all audio files matching the specified pattern (e.g., *.wav) in the 'input' directory. The --batch flag enables this functionality. ```bash python src/audio_transcriber.py input/*.wav --batch ``` -------------------------------- ### Transcribe Single Audio File Source: https://github.com/ombharatiya/transcript-ai/blob/main/cli/input/README.md Use this command to transcribe a single audio file. Ensure the file is placed in the 'input' directory. ```bash python src/audio_transcriber.py input/meeting.mp3 ``` -------------------------------- ### Advanced CLI Transcription Options Source: https://github.com/ombharatiya/transcript-ai/blob/main/README.md These commands demonstrate advanced features like translation, adjusting transcription temperature, specifying output directories, and skipping JSON details. ```bash # Translate to English python src/audio_transcriber.py input/foreign_audio.mp3 --task translate # Adjust sampling temperature for creative/technical content python src/audio_transcriber.py input/audio.wav --temperature 0.2 # Custom output directory python src/audio_transcriber.py input/audio.mp3 --output-dir /custom/path # Skip detailed JSON output python src/audio_transcriber.py input/audio.mp3 --no-json ``` -------------------------------- ### Transcribe Audio File with Custom Output Directory Source: https://github.com/ombharatiya/transcript-ai/blob/main/cli/input/README.md Specify a custom output directory for transcription results using the --output-dir flag. This is useful for organizing your transcripts. ```bash python src/audio_transcriber.py input/podcast.m4a --output-dir transcripts/ ``` -------------------------------- ### Reduce Model Size for Memory Errors Source: https://github.com/ombharatiya/transcript-ai/blob/main/README.md If you encounter out-of-memory errors, use a smaller Whisper model like 'tiny' to reduce resource consumption. ```bash # Use a smaller model python src/audio_transcriber.py large_file.mp3 --model tiny ``` -------------------------------- ### AudioTranscriber.batch_transcribe() Source: https://context7.com/ombharatiya/transcript-ai/llms.txt Processes a list of audio files sequentially. It loads the model only once for efficiency, captures per-file errors without stopping the batch, and returns a dictionary where keys are file paths and values are the results or error messages. ```APIDOC ## `AudioTranscriber.batch_transcribe()` — Multiple Files Processes a list of audio files sequentially, loads the model once, captures per-file errors without aborting the batch, and returns a dict keyed by file path. ### Method Signature `batch_transcribe(audio_paths: List[str], language: Optional[str] = None, task: str = "transcribe", temperature: float = 0.0, save_json: bool = False) -> Dict[str, Dict]` ### Parameters - **audio_paths** (List[str]) - A list of paths to the audio files to process. - **language** (Optional[str]) - The language of the audio files. If `None`, the language will be auto-detected for each file. Defaults to `None`. - **task** (str) - The task to perform, either "transcribe" (default) or "translate". Defaults to "transcribe". - **temperature** (float) - Controls the randomness of the predictions. Lower values make the output more deterministic. Defaults to `0.0`. - **save_json** (bool) - Whether to save the detailed transcription as a JSON file for each audio file. Defaults to `False`. ### Returns A dictionary where keys are the audio file paths and values are dictionaries containing either the transcription results or an 'error' key with the error message. ### Request Example ```python import glob from transcript_ai import AudioTranscriber transcriber = AudioTranscriber(model_size="small", output_dir="outputs/batch") # Collect audio files files = glob.glob("input/*.mp3") + glob.glob("input/*.wav") results = transcriber.batch_transcribe( files, language=None, # Auto-detect per file task="transcribe", temperature=0.0, save_json=True ) # Process results successful = {k: v for k, v in results.items() if "error" not in v} failed = {k: v for k, v in results.items() if "error" in v} print(f"Processed: {len(results)} | OK: {len(successful)} | Failed: {len(failed)}") # Access individual result print(results["input/sample_meeting.wav"]["text"][:100]) # Inspect errors for path, res in failed.items(): print(f"FAILED {path}: {res['error']}") ``` ``` -------------------------------- ### AudioTranscriber.load_model() Source: https://context7.com/ombharatiya/transcript-ai/llms.txt Loads the Whisper model into memory on the first call. Models are downloaded and cached locally on first use. Subsequent calls are no-ops. ```APIDOC ## `AudioTranscriber.load_model()` — Lazy Model Loading Loads the Whisper model into memory on first call; subsequent calls are no-ops. Models are downloaded from the internet on first use and cached locally. ```python transcriber = AudioTranscriber(model_size="medium") # Explicitly pre-load (optional — transcribe_audio calls this automatically) transcriber.load_model() # Logs: "Loading Whisper model (medium)..." # Logs: "Model loaded successfully" # Model is now cached: transcriber.model is set print(transcriber.model) # ``` ``` -------------------------------- ### Run CLI and Skip JSON Output Source: https://github.com/ombharatiya/transcript-ai/blob/main/web/src/docs.html Use the --no-json flag to prevent the CLI tool from generating JSON output. ```python python src/audio_transcriber.py audio.mp3 --no-json ``` -------------------------------- ### Transcription with Language Specification Source: https://github.com/ombharatiya/transcript-ai/blob/main/cli/README.md Explicitly set the language of the audio file (e.g., 'en' for English) if automatic detection is not desired or accurate. ```bash # Language specification python src/audio_transcriber.py input/audio.aac --language en ``` -------------------------------- ### Web Interface OpenAI API Call using fetch Source: https://context7.com/ombharatiya/transcript-ai/llms.txt Making a direct POST request to the OpenAI transcriptions endpoint using FormData and fetch in the browser. ```javascript const formData = new FormData(); formData.append('file', audioFileObject); // File object from input/drop formData.append('model', 'whisper-1'); formData.append('language', 'en'); // Optional ISO 639-1 code formData.append('response_format', 'verbose_json'); const response = await fetch('https://api.openai.com/v1/audio/transcriptions', { method: 'POST', headers: { 'Authorization': `Bearer sk-...your-key...` }, body: formData }); if (!response.ok) { // 401 → Invalid API key // 429 → Rate limit exceeded // 413 → File too large (>25 MB) } const data = await response.json(); // { // "text": "Full transcription text", // "language": "en", // "duration": 222.4, // "segments": [ // { "id": 0, "start": 0.0, "end": 4.2, "text": " Hello everyone." }, // ... // ] // } ``` -------------------------------- ### Podcast Episodes Transcription Source: https://github.com/ombharatiya/transcript-ai/blob/main/README.md Transcribe podcast episodes in batch mode using the 'large' model. ```bash python src/audio_transcriber.py input/podcast_*.mp3 --batch --model large ``` -------------------------------- ### Translation Task: Foreign Language to English Source: https://github.com/ombharatiya/transcript-ai/blob/main/cli/README.md Use the --task translate flag to transcribe audio in a foreign language and translate it to English. ```bash # Translation to English python src/audio_transcriber.py input/foreign.mp3 --task translate ``` -------------------------------- ### AudioTranscriber.get_audio_info() Source: https://context7.com/ombharatiya/transcript-ai/llms.txt Returns metadata about an audio file, including filename, size, and format, without loading the transcription model. ```APIDOC ## `AudioTranscriber.get_audio_info()` — File Metadata Returns a dictionary with filename, file size in MB, format extension, and whether the format is supported — without loading the model or processing audio. ```python transcriber = AudioTranscriber() info = transcriber.get_audio_info("input/sample_meeting.wav") print(info) # { # 'filename': 'sample_meeting.wav', # 'size_mb': 12.4, # 'format': '.wav', # 'supported': True # } info_bad = transcriber.get_audio_info("input/recording.xyz") print(info_bad) # { # 'filename': 'recording.xyz', # 'size_mb': 3.1, # 'format': '.xyz', # 'supported': False # } ``` ``` -------------------------------- ### AudioTranscriber.is_supported_format() Source: https://context7.com/ombharatiya/transcript-ai/llms.txt Checks if a given file extension is among the supported audio formats for transcription. ```APIDOC ## `AudioTranscriber.is_supported_format()` — Format Validation Checks whether a file's extension belongs to the supported set: `.aac`, `.flac`, `.mp3`, `.mp4`, `.m4a`, `.ogg`, `.wav`, `.webm`. ```python transcriber = AudioTranscriber() print(transcriber.is_supported_format("audio.mp3")) # True print(transcriber.is_supported_format("audio.flac")) # True print(transcriber.is_supported_format("audio.wma")) # False print(transcriber.is_supported_format("video.mkv")) # False # Convert an unsupported format first, then transcribe import subprocess subprocess.run(["ffmpeg", "-i", "input/recording.wma", "-c:a", "aac", "input/recording.aac"]) result = transcriber.transcribe_audio("input/recording.aac") ``` ``` -------------------------------- ### Trigger GitHub Pages Deployment Source: https://github.com/ombharatiya/transcript-ai/blob/main/DEPLOYMENT_GUIDE.md Commit and push changes to the main branch to trigger the GitHub Actions workflow for deployment. ```bash git add . git commit -m "Enable GitHub Pages with GitHub Actions workflow" git push origin main ``` -------------------------------- ### Proposed Monorepo Project Structure Source: https://github.com/ombharatiya/transcript-ai/blob/main/PROJECT_STRUCTURE.md The proposed monorepo structure organizes the project into distinct components: a Python CLI, a web interface, shared resources, and GitHub Actions workflows. This facilitates unified development and deployment. ```tree transcript-ai/ ├── cli/ # Python CLI Tool │ ├── src/ │ │ └── audio_transcriber.py │ ├── input/ # Sample audio files │ ├── outputs/ # Sample transcriptions │ ├── config/ │ ├── requirements.txt │ ├── setup.py │ └── README_CLI.md │ ├── web/ # Web Interface │ ├── src/ │ │ ├── index.html │ │ ├── app.js │ │ └── styles.css │ ├── public/ │ ├── dist/ # Built files for GitHub Pages │ ├── package.json │ └── README_WEB.md │ ├── docs/ # GitHub Pages (symbolic link to web/dist) │ ├── shared/ # Common resources │ ├── examples/ │ ├── assets/ │ └── docs/ │ ├── .github/ │ ├── workflows/ │ │ ├── test-cli.yml # CI for Python CLI │ │ ├── build-web.yml # Build web interface │ │ └── deploy-pages.yml # Deploy to GitHub Pages │ └── ISSUE_TEMPLATE/ │ ├── README.md # Main project documentation ├── CONTRIBUTING.md ├── LICENSE └── CHANGELOG.md ``` -------------------------------- ### Batch Transcribe Multiple Audio Files Source: https://context7.com/ombharatiya/transcript-ai/llms.txt Use `batch_transcribe` to process a list of audio files efficiently. It loads the model only once and handles individual file errors without stopping the entire batch. The results are returned as a dictionary keyed by file path. ```python import glob from src.audio_transcriber import AudioTranscriber transcriber = AudioTranscriber(model_size="small", output_dir="outputs/batch") # Collect files files = glob.glob("input/*.mp3") + glob.glob("input/*.wav") results = transcriber.batch_transcribe( files, language=None, # Auto-detect per file task="transcribe", temperature=0.0, save_json=True ) # Summary successful = {k: v for k, v in results.items() if "error" not in v} failed = {k: v for k, v in results.items() if "error" in v} print(f"Processed: {len(results)} | OK: {len(successful)} | Failed: {len(failed)}") # Processed: 8 | OK: 7 | Failed: 1 # Access individual result print(results["input/sample_meeting.wav"]["text"][:100]) # "Good morning. Let's get started with today's agenda..." # Inspect errors for path, res in failed.items(): print(f"FAILED {path}: {res['error']}") # FAILED input/corrupt.mp3: Audio file not found: input/corrupt.mp3 ```