Skip to main content

Speech Recognition Library

Project description

MetaidigitSTT

MetaidigitSTT is a lightweight Speech-to-Text (STT) recognition module utilizing Groq's Whisper model for high-accuracy transcription. It enables real-time audio recording and transcription using Python.

Features

  • Records audio via microphone and saves it as an MP3 file.
  • Uses Groq's Whisper-Large-V3 model for transcription.
  • Simple and easy-to-use API.

Installation

Ensure you have Python 3.10 or higher installed.

Using Pip

pip install -r requirements.txt

Required Dependencies

  • ffmpeg
  • SpeechRecognition
  • pyaudio
  • pydub
  • groq
  • python-dotenv

You may need to install ffmpeg manually:

# Ubuntu/Linux
sudo apt install ffmpeg

# macOS
brew install ffmpeg

# Windows
choco install ffmpeg

Usage

1. Recording Audio

The record_audio function records audio from the microphone and saves it as an MP3 file.

from metaidigitstt import record_audio

record_audio("audio/test.mp3", timeout=20, phrase_time_limit=10)

2. Transcribing Audio

The transcribe_with_groq function transcribes recorded audio using Groq's Whisper model.

from metaidigitstt import transcribe_with_groq

GROQ_API_KEY = "your_api_key_here"
stt_model = "whisper-large-v3"
audio_filepath = "audio/test.mp3"

transcription = transcribe_with_groq(stt_model, audio_filepath, GROQ_API_KEY)
print(transcription)

Environment Variables

Set up your API key in a .env file:

GROQ_API_KEY=your_api_key_here

Packaging & Deployment

To install the package locally:

pip install metaidigitstt

License

This project is licensed under the MIT License.

Author

Suhal Samad

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

metaidigitstt-0.1.3.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

metaidigitstt-0.1.3-py3-none-any.whl (3.6 kB view details)

Uploaded Python 3

File details

Details for the file metaidigitstt-0.1.3.tar.gz.

File metadata

  • Download URL: metaidigitstt-0.1.3.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.0

File hashes

Hashes for metaidigitstt-0.1.3.tar.gz
Algorithm Hash digest
SHA256 f9d16b553bdb9b26426a109edc120fcc23b82da891dc17d77c1540fac67d3b99
MD5 08a5e5087bd0bbdb4da4ccc26ad4bfc6
BLAKE2b-256 5757b0ea685a9679c410d87b41e515332d1c2d6e820a9c286214029fbade5fb5

See more details on using hashes here.

File details

Details for the file metaidigitstt-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: metaidigitstt-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 3.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.0

File hashes

Hashes for metaidigitstt-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 de02c3485975496d66fefcc03284d0ac1244235bcf22f0bef1671b98ec504bdd
MD5 4321f98282249265d012e0681305c137
BLAKE2b-256 def33663985f7db7e9999ae045f41141a1b5bd1b70041f5773fd5db1fff991bd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page