SplitOptions controls how Tafrigh splits your audio files into manageable chunks. This is crucial for working with services like Wit.ai that impose duration limits. The splitting strategy uses silence detection to avoid cutting through words, which would reduce transcription accuracy.
Why splitting matters
Splitting audio files into chunks serves several purposes:- API compatibility: Services like Wit.ai have maximum duration limits per request
- Parallel processing: Multiple chunks can be transcribed concurrently using different API keys
- Quality preservation: Splitting on silence prevents cutting through words
- Timestamp granularity: Chunk duration affects the detail level of your timestamps
Configuration
You passsplitOptions to the transcribe() function:
Properties
Maximum length of each audio chunk in seconds.The actual chunk length may be shorter if splitting at the maximum duration would cut through speech. Tafrigh automatically finds the last silence before the duration limit to ensure clean splits.
Must be between 4 and 300 seconds. This value also affects timestamp granularity—longer chunks mean less detailed timestamps.
Minimum length of each chunk in seconds.Chunks shorter than this threshold are automatically filtered out. This prevents creating tiny, unusable chunks from brief audio artifacts.
Configuration for detecting silence in the audio to determine optimal split points.
Examples
Fast-paced podcast
For rapid conversation with minimal pauses:Lecture with long pauses
For educational content with deliberate pauses:Noisy environment recording
For audio with significant background noise:Maximum duration chunks
For the longest allowed chunks (better for slower processing or API limits):How chunks are processed
After splitting, each chunk undergoes additional processing:- Padding: Silent padding is added to chunk boundaries
- Normalization: Volume levels are normalized for consistency
- Filtering: Chunks below
chunkMinThresholdare removed
Related
Preprocess options
Configure noise reduction and audio preprocessing
Transcribe function
Main transcription function reference