New Tool Radar

Local AI

How to Transcribe Long Audio with faster-whisper chunk_length

Split long recordings into chunks with faster-whisper chunk_length so memory stays flat.

Schematic illustration with three step boxes: Pick a long file; Set the chunk length; Check the joins.

A two-hour recording can use a lot of memory if it is decoded in one piece. faster-whisper’s chunk_length setting, 30 seconds by default, splits the audio into chunks that are decoded one at a time. This guide sets a chunk length for a long file and checks that the transcript reads cleanly across the joins.

Before you start

  • Python with faster-whisper installed.
  • A long audio file, at least 30 minutes, for example a recorded lecture.
  • A terminal and a text editor.

Pick the file and the chunk length

Start with the default chunk_length of 30 seconds. If the machine is short on memory, try a shorter chunk such as 15 seconds; if it has memory to spare, a longer chunk such as 60 seconds can give smoother context across the joins.

Transcribe with the chunk length

Run the transcription with the setting:

from faster_whisper import WhisperModel
model = WhisperModel("base", device="cpu", compute_type="int8")
segments, info = model.transcribe("lecture.wav", chunk_length=30)
for s in segments:
    print(s.start, s.text)

Save the full output to a text file.

Check the joins

Read the transcript around each 30-second boundary. The sentences should flow across the joins without repeated or missing words. If a sentence is cut in half at a join, the chunk boundary fell inside it; a shorter or longer chunk length can move the cut.

Worked example

Worked example: a 45-minute lecture. With chunk_length=30, the transcript should be one continuous text with no duplicated sentences at the joins. Count the words in the transcript and compare with a rough estimate from the recording length: about 150 words per minute of speech, so 45 minutes should give roughly 6,000 to 7,000 words.

Expected result

UNTESTED in this guide: no transcription was run while writing it. The expected result is that the long file transcribes in chunks and the text reads cleanly across the joins, with roughly 6,000 to 7,000 words for 45 minutes.

Limitations

Chunking splits the audio, not the meaning: a sentence that straddles a boundary can still be cut. For the cleanest result, combine chunking with condition_on_previous_text so each chunk sees what came before.

Sources

See all