Skip to content

whisperx

pixeltable.ext.functions.whisperx

transcribe

transcribe(
    audio: Audio,
    *,
    model: String,
    compute_type: Optional[String] = None,
    language: Optional[String] = None,
    chunk_size: Int = 30
) -> Json

Transcribe an audio file using WhisperX.

This UDF runs a transcription model locally using the WhisperX library, equivalent to the WhisperX transcribe function, as described in the WhisperX library documentation.

WhisperX is part of the pixeltable.ext package: long-term support in Pixeltable is not guaranteed.

Requirements:

  • pip install whisperx

Parameters:

  • audio (Audio) –

    The audio file to transcribe.

  • model (String) –

    The name of the model to use for transcription.

See the WhisperX library documentation for details on the remaining parameters.

Returns:

  • Json

    A dictionary containing the transcription and various other metadata.

Examples:

Add a computed column that applies the model tiny.en to an existing Pixeltable column tbl.audio of the table tbl:

>>> tbl['result'] = transcribe(tbl.audio, model='tiny.en')