Skip to main content

A Python package for audio recording and transcribing

Project description

pyaudiocook

A Python package for recording and transcribing audio.

Installation

pip install pyaudiocook

Usage

The package contains two classes: AudioRecorder and AudioTranscriber.

AudioRecorder

Example: start recording

recorder = AudioRecorder()
recorder.start_recording()

Example: pause/resume recording

recorder = AudioRecorder()
recorder.toggle_recording()

Example: stop recording

recorder = AudioRecorder()
recorder.stop_recording()

AudioTranscriber

Before getting started, make sure you have already obtained an API key on OpenAI. If you have not done so, follow this guide to create one.

Example: Local whisper model and single audio file

# Transcribe using local whisper model, which is the default
transcriber = AudioTranscriber('audio_1.wav')
transcriber.transcribe()
print(transcriber.texts)

Example: Local whisper model and multiple audio file

# You can pass multiple audio files for transcribing
transcriber = AudioTranscriber('audio_1.wav', 'audio_2.wav')
transcriber.transcribe()
print(transcriber.texts)

Example: Calling OpenAI API

Note: API usage fee applies.

# You can pass multiple audio files for transcribing
transcriber = AudioTranscriber('audio_1.wav', 'audio_2.wav', mode='remote')
transcriber.transcribe()
print(transcriber.texts)

Example: Using another model

Note: this only applies when local whisper model is used

# Default is tiny.en
transcriber = AudioTranscriber('audio_1.wav', 'audio_2.wav', mode='local', model='base.en')
transcriber.transcribe()
print(transcriber.texts)

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

pyaudiocook-1.0.2.tar.gz (3.4 kB view details)

Uploaded Source

Built Distribution

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

pyaudiocook-1.0.2-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file pyaudiocook-1.0.2.tar.gz.

File metadata

  • Download URL: pyaudiocook-1.0.2.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for pyaudiocook-1.0.2.tar.gz
Algorithm Hash digest
SHA256 01017deb7750e4751ca6a270dbe1e7f141034289336319920ffb7a830f4aa120
MD5 e1801678a8c9c4c696d949c47fbc09a9
BLAKE2b-256 bc8c03cf8ba3f9a4975e519a286693670342fdb77e4a976f1d7bcb8b387aa9d1

See more details on using hashes here.

File details

Details for the file pyaudiocook-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: pyaudiocook-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 4.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for pyaudiocook-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 44c939d470e6c48aac288814336e08d2fe5b1098592ff090e0cbd8b297d43d4a
MD5 623f45b6d409002b1ab4bcb464fdac19
BLAKE2b-256 86a1a919768007581afbe19fd99829947dfbf13138ecd0ce8a1b14e96f3c4856

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