/chunk-whisper

A whisper CLI that will transcribe your microphone, chunking it every time you make a silence pause.

Primary LanguagePythonApache License 2.0Apache-2.0

Chunk Whisper

This is a simple whisper CLI application that instead of streaming whisper, it will only run the model after a 3 second pause.

Installation

pipenv install

Usage

pipenv run python record.py

It will first prompt you to select a microphone, and after that it will start recording. Pressing enter will stop the recording and run the model on the recorded audio.

If your audio has 3 seconds of silence, it will run the model on the audio and count that as a paragraph.

Configuration

Argument Description Default
--model The whisper model to use. list small
--microphone Microphone name. The first match that contains this string will be picked. Special options: pick will prompt you to pick one. default will figure out the first valid one. pick (default if --silent is used)
--silent Don't write anything in the console except for the translated audio, and a "Start" to know when to start talking. False
--pause-seconds Seconds of silence to wait for making a new chunk (paragraph). 3
--debug Print debug information. False

Example usages

Useful to simply get started with the model.

pipenv run python record.py --silent

To try different models. Check them all here.

pipenv run python record.py --silent --model=base

To use a fixed microphone. Note that --microphone=pick does not work with --silent.

pipenv run python record.py --silent --microphone="MacBook Pro Microphone"

To add the content to a file after running the model. (you won't see the "start" prompt)

pipenv run python record.py --microphone="default" >> file.txt

To-do

  • Fix the Ctrl+D exit. Make it gracefully exit.