Welcome to Tafrigh
Tafrigh is a Node.js audio processing library that simplifies the process of transcribing audio files using Wit.ai. The library includes built-in support for splitting audio into chunks, noise reduction, and managing multiple API keys to optimize transcription workflows for larger files.Key features
Audio splitting
Automatically splits audio files into manageable chunks based on silence detection, ideal for services with file or duration size limits
Noise reduction
Apply configurable noise reduction and dialogue enhancement to improve transcription accuracy
Multiple input formats
Supports streams, remote media file URLs, or local media file paths in any format supported by FFmpeg
API key rotation
Cycle through multiple Wit.ai API keys to prevent rate limits and enable higher concurrency
Smart concurrency
Control worker concurrency and resume failed jobs with built-in retry logic and exponential backoff
Rich error reporting
Failures capture failed chunks, successful transcripts, and working directory for easy debugging and resumption
How it works
Thetranscribe function provides an end-to-end transcription pipeline:
- Preprocess - Formats media, applies noise reduction and dialogue enhancement
- Split - Splits audio into chunks based on silence detection to avoid word breaks
- Transcribe - Sends chunks to Wit.ai API with smart key rotation and concurrency
- Merge - Combines results into typed segment objects with timestamps
Example output
Next steps
Installation
Install Tafrigh using your preferred package manager
Quick start
Get your first transcription working in minutes
Guides
Learn advanced features like noise reduction and error handling
API reference
Explore the complete API documentation