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.1.tar.gz (3.4 kB view hashes)

Uploaded Source

Built Distribution

pyaudiocook-1.0.1-py3-none-any.whl (4.3 kB view hashes)

Uploaded Python 3

Supported by

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