Skip to content

whisperx

pixeltable.ext.functions.whisperx

transcribe

transcribe(
    audio: AudioT,
    *,
    model: str,
    compute_type: str = None,
    language: str = None,
    chunk_size: int = 30
) -> JsonT

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 (AudioT) –

    The audio file to transcribe.

  • model (str) –

    The name of the model to use for transcription.

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

Returns:

  • JsonT

    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')