Skip to main content

Whisper Mic

This repo is based on the work done here by OpenAI. This repo allows you use use a mic as demo. This repo copies some of the README from the original project.

Video Tutorial

The latest video tutorial for this repo can be seen here

An older video tutorial for this repo can be seen here

Professional Assistance

If are in need of paid professional help, that is available through this email

Setup

Now a pip package!

  1. Create a venv of your choice.
  2. Run pip install whisper-mic

Available models and languages

There are five model sizes, four with English-only versions, offering speed and accuracy tradeoffs. Below are the names of the available models and their approximate memory requirements and relative speed.

Size Parameters English-only model Multilingual model Required VRAM Relative speed
tiny 39 M tiny.en tiny ~1 GB ~32x
base 74 M base.en base ~1 GB ~16x
small 244 M small.en small ~2 GB ~6x
medium 769 M medium.en medium ~5 GB ~2x
large 1550 M N/A large ~10 GB 1x

For English-only applications, the .en models tend to perform better, especially for the tiny.en and base.en models. We observed that the difference becomes less significant for the small.en and medium.en models.

Microphone Demo

You can use the model with a microphone using the whisper_mic program. Use -h to see flag options.

Some of the more important flags are the --model and --english flags.

Transcribing To A File

Using the command: whisper_mic --loop --dictate will type the words you say on your active cursor.

Usage In Other Projects

You can use this code in other projects rather than just use it for a demo. You can do this with the listen method.

from whisper_mic import WhisperMic

mic = WhisperMic()
result = mic.listen()
print(result)

Check out what the possible arguments are by looking at the cli.py file

Troubleshooting

If you are having issues, try the following:

sudo apt install portaudio19-dev python3-pyaudio

Contributing

Some ideas that you can add are:

  1. Supporting different implementations of Whisper
  2. Adding additional optional functionality.
  3. Add tests

License

The model weights of Whisper are released under the MIT License. See their repo for more information.

This code under this repo is under the MIT license. See LICENSE for further details.

Thanks

Until recently, access to high performing speech to text models was only available through paid serviecs. With this release, I am excited for the many applications that will come.

Metadata

Release files for whisper-mic 1.4.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for whisper-mic 1.4.4
File Size Uploaded Provenance Actions
whisper_mic-1.4.4.tar.gz 9.7 kB Without provenance Details for whisper_mic-1.4.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for whisper-mic 1.4.4
File Interpreter ABI Platform Actions
whisper_mic-1.4.4-py3-none-any.whl Python 3 none any Details for whisper_mic-1.4.4-py3-none-any.whl

Total release size: 18.5 kB

Release files / whisper_mic-1.4.4.tar.gz

Download URL whisper_mic-1.4.4.tar.gz
Size 9.7 kB
Tags Source
SHA-256 checksum
How to use checksums
b94ea29d358aaa6cb9035b67625955945c3fb329ea52ae3d599a513b4cc6c778
BLAKE2b-256 checksum
How to use checksums
2685aedd82bc0a0e1bbdb51c040f2a17ae03a965ae0f116e371f28b0d204c674
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.11.8

Release files / whisper_mic-1.4.4-py3-none-any.whl

Download URL whisper_mic-1.4.4-py3-none-any.whl
Size 8.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4babecaa01a759143902230e85b3ca1396803cac0d9f9030cfba6e92f00e1f07
BLAKE2b-256 checksum
How to use checksums
8cf9f9e1415df72ea5f2769a7967501ef6ff874d32ae81bec75fb0e588b1f91c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.11.8

Security for whisper-mic 1.4.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page