Skip to main content

Overview

The TranscribeOptions type defines all configuration options you can pass to the transcribe() function to customize the transcription process. All properties are optional, allowing you to choose only the options you need.

Type definition

type TranscribeOptions = {
    callbacks?: Callbacks;
    concurrency?: number;
    preprocessOptions?: PreprocessOptions;
    preventCleanup?: boolean;
    retries?: number;
    splitOptions?: SplitOptions;
};

Properties

callbacks
Callbacks
Callbacks for monitoring progress and responding to events during transcription.See the Callbacks reference for details on available callback functions.
concurrency
number
Maximum number of concurrent transcription operations.
Concurrency is limited by the number of available API keys. If you specify a concurrency higher than your number of API keys, it will be automatically reduced to match the number of keys.
Default: 1
preprocessOptions
PreprocessOptions
Options for audio preprocessing including noise reduction, filtering, and normalization.See the PreprocessOptions reference for available preprocessing options.
preventCleanup
boolean
If true, temporary processing directories won’t be deleted after transcription completes.This is useful for debugging when you need to inspect intermediate files like audio chunks or preprocessed audio.Default: false
retries
number
Number of retry attempts for failed transcription requests.The library uses exponential backoff between retries to avoid overwhelming the API.Default: 0 (no retries)
splitOptions
SplitOptions
Options for splitting audio into chunks based on silence detection.See the SplitOptions reference for configuration details.

Usage example

import { transcribe } from 'tafrigh';

const transcript = await transcribe('audio.mp3', {
  concurrency: 3,
  retries: 2
});

transcribe

Main transcription function

Callbacks

Callback interface reference

SplitOptions

Audio splitting configuration

PreprocessOptions

Audio preprocessing options

Build docs developers (and LLMs) love